Skip to content

Commit

Permalink
ChainID Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Apr 8, 2024
1 parent 7683129 commit f958922
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cmd/ethermintd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,11 @@ func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer,
)

// Setup chainId
chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if len(chainID) == 0 {
// fallback to genesis chain-id
appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json"))
if err != nil {
panic(err)
}
chainID = appGenesis.ChainID
appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json"))
if err != nil {
panic(err)
}
chainID := appGenesis.ChainID

ethermintApp := app.NewEthermintApp(
logger, db, traceStore, true, skipUpgradeHeights,
Expand Down

0 comments on commit f958922

Please sign in to comment.