Skip to content

Commit

Permalink
️fix: load genesis path from config when executue newApp
Browse files Browse the repository at this point in the history
  • Loading branch information
diesel-dunamu committed Feb 27, 2024
1 parent 99f8548 commit 80f8e08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/neutrond/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ func (ac appCreator) newApp(
chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if chainID == "" {
// fallback to genesis chain-id
appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json"))
genDocFile := filepath.Join(homeDir, cast.ToString(appOpts.Get("genesis_file")))
appGenesis, err := tmtypes.GenesisDocFromFile(genDocFile)
if err != nil {
panic(err)
}
Expand All @@ -243,7 +244,7 @@ func (ac appCreator) newApp(
}

return app.New(logger, db, traceStore, true, skipUpgradeHeights,
cast.ToString(appOpts.Get(flags.FlagHome)),
homeDir,
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
ac.encCfg,
appOpts,
Expand Down

0 comments on commit 80f8e08

Please sign in to comment.