Skip to content

Commit

Permalink
fix(cmd): Check if config.Genesis is provided on node start (dymensio…
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 authored Apr 15, 2024
1 parent f340371 commit 4e1d383
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cmd/dymint/commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import (
"io"
"os"

cfg "github.com/dymensionxyz/dymint/config"
"github.com/dymensionxyz/dymint/conv"
"github.com/dymensionxyz/dymint/mempool"
"github.com/dymensionxyz/dymint/node"
"github.com/dymensionxyz/dymint/rpc"
"github.com/spf13/cobra"
"github.com/spf13/viper"
tmcfg "github.com/tendermint/tendermint/config"
Expand All @@ -22,6 +17,12 @@ import (
tmnode "github.com/tendermint/tendermint/node"
tmp2p "github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/proxy"

cfg "github.com/dymensionxyz/dymint/config"
"github.com/dymensionxyz/dymint/conv"
"github.com/dymensionxyz/dymint/mempool"
"github.com/dymensionxyz/dymint/node"
"github.com/dymensionxyz/dymint/rpc"
)

var genesisHash []byte
Expand Down Expand Up @@ -128,7 +129,11 @@ func startInProcess(config *cfg.NodeConfig, tmConfig *tmcfg.Config, logger log.L
}

func checkGenesisHash(config *tmcfg.Config) error {
if len(genesisHash) == 0 || config.Genesis == "" {
if config.Genesis == "" {
return fmt.Errorf("genesis file is not set")
}

if len(genesisHash) == 0 {
return nil
}

Expand Down

0 comments on commit 4e1d383

Please sign in to comment.