diff --git a/cmd/rollappd/cmd/root.go b/cmd/rollappd/cmd/root.go index 1e487bb..5f93f5a 100644 --- a/cmd/rollappd/cmd/root.go +++ b/cmd/rollappd/cmd/root.go @@ -14,6 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/evmos/evmos/v12/crypto/hd" + berpcconfig "github.com/bcdevtools/block-explorer-rpc-cosmos/be_rpc/config" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -105,6 +106,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { chainID := client.GetClientContextFromCmd(cmd).ChainID dymintconf.EnsureRoot(home, dymintconf.DefaultConfig(home, chainID)) + //create Block Explorer Json-RPC toml config file + berpcconfig.EnsureRoot(home, berpcconfig.DefaultBeJsonRpcConfig()) + return nil }, } diff --git a/cmd/rollappd/cmd/start.go b/cmd/rollappd/cmd/start.go index 692edc9..6053247 100644 --- a/cmd/rollappd/cmd/start.go +++ b/cmd/rollappd/cmd/start.go @@ -164,9 +164,15 @@ which accepts a path for the resulting pprof file. return err } + beJsonRpcConfig := berpccfg.DefaultBeJsonRpcConfig() + err = beJsonRpcConfig.GetViperConfig(cmd, serverCtx.Viper.GetString(flags.FlagHome)) + if err != nil { + return err + } + // amino is needed here for backwards compatibility of REST routes err = wrapCPUProfile(serverCtx, func() error { - return startInProcess(serverCtx, clientCtx, dymconfig, appCreator) + return startInProcess(serverCtx, clientCtx, dymconfig, beJsonRpcConfig, appCreator) }) errCode, ok := err.(server.ErrorCode) if !ok { @@ -242,7 +248,7 @@ which accepts a path for the resulting pprof file. return cmd } -func startInProcess(ctx *server.Context, clientCtx client.Context, nodeConfig *dymintconf.NodeConfig, appCreator types.AppCreator) error { +func startInProcess(ctx *server.Context, clientCtx client.Context, nodeConfig *dymintconf.NodeConfig, beRpcCfg *berpccfg.BeJsonRpcConfig, appCreator types.AppCreator) error { cfg := ctx.Config home := cfg.RootDir @@ -267,11 +273,6 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, nodeConfig *d return err } - beRpcCfg, err := berpccfg.GetConfig(ctx.Viper) - if err != nil { - return err - } - if err := beRpcCfg.Validate(); err != nil { return err } @@ -520,7 +521,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, nodeConfig *d ctx, clientCtx, genDoc.ChainID, - beRpcCfg, + *beRpcCfg, idxer, nil, // external services modifier func(evmberpcbackend.EvmBackendI) {