yggdrasil rocks (finally checked, everything OK)
This commit is contained in:
parent
c8da753a23
commit
7e02054f35
2 changed files with 6 additions and 9 deletions
|
|
@ -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) {
|
func newTendermint(app abci.Application, config *cfg.Config, laddrReturner chan string) (*nm.Node, error) {
|
||||||
config.P2P.ListenAddress = "tcp://" + <-laddrReturner
|
config.P2P.ListenAddress = "tcp://" + <-laddrReturner
|
||||||
|
|
||||||
//if config.P2P.PersistentPeers == "" {
|
|
||||||
config.P2P.PersistentPeers = <-laddrReturner
|
config.P2P.PersistentPeers = <-laddrReturner
|
||||||
//} else {
|
|
||||||
// <- laddrReturner
|
|
||||||
//}
|
|
||||||
|
|
||||||
var pv tmTypes.PrivValidator
|
var pv tmTypes.PrivValidator
|
||||||
if _, err := os.Stat(config.PrivValidatorKeyFile()); err == nil {
|
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 {
|
func Run(ctx context.Context, dbPath string, config *cfg.Config, laddrReturner chan string) error {
|
||||||
db, err := openBadger(dbPath)
|
db, err := openBadger(dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -128,12 +122,10 @@ func Run(ctx context.Context, dbPath string, config *cfg.Config, laddrReturner c
|
||||||
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// ждём контекст или внутренних ошибок узла
|
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
case <-node.Quit(): // Tendermint закрылся сам
|
case <-node.Quit():
|
||||||
return err
|
return err
|
||||||
// Node quit signal received
|
|
||||||
}
|
}
|
||||||
node.Stop()
|
node.Stop()
|
||||||
node.Wait()
|
node.Wait()
|
||||||
|
|
|
||||||
5
shell.nix
Normal file
5
shell.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
pkgs.mkShell {
|
||||||
|
# nativeBuildInputs is usually what you want -- tools you need to run
|
||||||
|
buildInputs = with pkgs; [ go gopls git delve ];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue