diff --git a/blockchain/main.go b/blockchain/main.go index 7819741..092d159 100644 --- a/blockchain/main.go +++ b/blockchain/main.go @@ -23,12 +23,7 @@ func openBadger(path string) (*badger.DB, error) { func newTendermint(app abci.Application, config *cfg.Config, laddrReturner chan string) (*nm.Node, error) { config.P2P.ListenAddress = "tcp://" + <-laddrReturner - - //if config.P2P.PersistentPeers == "" { config.P2P.PersistentPeers = <-laddrReturner - //} else { - // <- laddrReturner - //} var pv tmTypes.PrivValidator if _, err := os.Stat(config.PrivValidatorKeyFile()); err == nil { @@ -108,7 +103,6 @@ func GetNodeInfo(config *cfg.Config, dbPath string) (p2p.NodeInfo, error) { } -// В blockchain/run.go func Run(ctx context.Context, dbPath string, config *cfg.Config, laddrReturner chan string) error { db, err := openBadger(dbPath) if err != nil { @@ -128,12 +122,10 @@ func Run(ctx context.Context, dbPath string, config *cfg.Config, laddrReturner c }() - // ждём контекст или внутренних ошибок узла select { case <-ctx.Done(): - case <-node.Quit(): // Tendermint закрылся сам + case <-node.Quit(): return err - // Node quit signal received } node.Stop() node.Wait() diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..41201b0 --- /dev/null +++ b/shell.nix @@ -0,0 +1,5 @@ +{ pkgs ? import {} }: + pkgs.mkShell { + # nativeBuildInputs is usually what you want -- tools you need to run + buildInputs = with pkgs; [ go gopls git delve ]; +}