Skip to content

Commit

Permalink
fix start command
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer-zq committed Jan 2, 2025
1 parent 71048ca commit 4dfa007
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import (
"github.com/cometbft/cometbft/proxy"
rpcclient "github.com/cometbft/cometbft/rpc/client"
"github.com/cometbft/cometbft/rpc/client/local"
cmttypes "github.com/cometbft/cometbft/types"
dbm "github.com/cosmos/cosmos-db"

ethmetricsexp "github.com/ethereum/go-ethereum/metrics/exp"
Expand All @@ -61,6 +62,7 @@ import (
servercmtlog "github.com/cosmos/cosmos-sdk/server/log"
"github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"

"github.com/evmos/ethermint/indexer"
ethdebug "github.com/evmos/ethermint/rpc/namespaces/ethereum/debug"
Expand Down Expand Up @@ -363,7 +365,7 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start
return err
}

genDocProvider := node.DefaultGenesisDocProviderFunc(cfg)
genDocProvider := getGenDocProvider(cfg)

var (
tmNode *node.Node
Expand Down Expand Up @@ -732,3 +734,15 @@ func startRosettaServer(
g.Go(rosettaSrv.Start)
return nil
}

// returns a function which returns the genesis doc from the genesis file.
func getGenDocProvider(cfg *cmtcfg.Config) func() (*cmttypes.GenesisDoc, error) {
return func() (*cmttypes.GenesisDoc, error) {
appGenesis, err := genutiltypes.AppGenesisFromFile(cfg.GenesisFile())
if err != nil {
return nil, err
}

return appGenesis.ToGenesisDoc()
}
}

0 comments on commit 4dfa007

Please sign in to comment.