yggdrasil rocks (finally checked, everything OK)

This commit is contained in:
Gregory Bednov 2025-08-04 00:54:23 +03:00
commit 7e02054f35
2 changed files with 6 additions and 9 deletions

View file

@ -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()

5
shell.nix Normal file
View 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 ];
}