diff --git a/app/app.go b/app/app.go index 4a534622..bce14aa8 100644 --- a/app/app.go +++ b/app/app.go @@ -529,7 +529,7 @@ func NewMigalooApp( // Configure the hooks keeper hooksKeeper := ibchookskeeper.NewKeeper( - keys[ibchookstypes.StoreKey], + app.keys[ibchookstypes.StoreKey], ) app.IBCHooksKeeper = &hooksKeeper diff --git a/cmd/migalood/cmd/root.go b/cmd/migalood/cmd/root.go index 8d6fc5b0..993bbc60 100644 --- a/cmd/migalood/cmd/root.go +++ b/cmd/migalood/cmd/root.go @@ -2,12 +2,14 @@ package cmd import ( "errors" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "io" "os" "path/filepath" + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cast" @@ -145,7 +147,7 @@ func initAppConfig() (string, interface{}) { // own app.toml to override, or use this default value. // // In simapp, we set the min gas prices to 0. - srvCfg.MinGasPrices = "0whale" + srvCfg.MinGasPrices = "0.25uwhale" // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default customAppConfig := CustomAppConfig{ @@ -194,7 +196,8 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { keys.Commands(app.DefaultNodeHome), ) - server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) + // add rosetta + rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) } func addModuleInitFlags(startCmd *cobra.Command) { @@ -293,6 +296,19 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a skipUpgradeHeights[int64(h)] = true } + homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) + + chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) + if chainID == "" { + // fallback to genesis chain-id + appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) + if err != nil { + panic(err) + } + + chainID = appGenesis.ChainID + } + return app.NewMigalooApp( logger, db, @@ -314,6 +330,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), baseapp.SetSnapshot(snapshotStore, snapshotOptions), + baseapp.SetChainID(chainID), ) }