From 40433541bc2d5c532dde1ea8426da3b6736883c3 Mon Sep 17 00:00:00 2001 From: Oleg Nikonychev Date: Thu, 23 May 2024 21:35:02 +0400 Subject: [PATCH] chore(evm): disabled json rpc by default --- app/server/config/server_config.go | 2 +- contrib/scripts/localnet.sh | 4 ++++ x/common/testutil/cli/network.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/server/config/server_config.go b/app/server/config/server_config.go index 18ad43d93..5b34d7a77 100644 --- a/app/server/config/server_config.go +++ b/app/server/config/server_config.go @@ -242,7 +242,7 @@ func GetAPINamespaces() []string { // DefaultJSONRPCConfig returns an EVM config with the JSON-RPC API enabled by default func DefaultJSONRPCConfig() *JSONRPCConfig { return &JSONRPCConfig{ - Enable: true, + Enable: false, API: GetDefaultAPINamespaces(), Address: DefaultJSONRPCAddress, WsAddress: DefaultJSONRPCWsAddress, diff --git a/contrib/scripts/localnet.sh b/contrib/scripts/localnet.sh index d8cf41e9e..df2c86e4f 100755 --- a/contrib/scripts/localnet.sh +++ b/contrib/scripts/localnet.sh @@ -149,6 +149,10 @@ $BINARY config # Prints config. echo_info "config/app.toml: Enabling API server" sed -i $SEDOPTION '/\[api\]/,+3 s/enable = false/enable = true/' $CHAIN_DIR/config/app.toml +# Enable JSON RPC Server +echo_info "config/app.toml: Enabling JSON API server" +sed -i $SEDOPTION '/\[json\-rpc\]/,+3 s/enable = false/enable = true/' $CHAIN_DIR/config/app.toml + # Enable Swagger Docs echo_info "config/app.toml: Enabling Swagger Docs" sed -i $SEDOPTION 's/swagger = false/swagger = true/' $CHAIN_DIR/config/app.toml diff --git a/x/common/testutil/cli/network.go b/x/common/testutil/cli/network.go index 551846308..7a15e867a 100644 --- a/x/common/testutil/cli/network.go +++ b/x/common/testutil/cli/network.go @@ -167,7 +167,7 @@ func NewAppConstructor(encodingCfg app.EncodingConfig, chainID string) AppConstr func BuildNetworkConfig(appGenesis app.GenesisState) Config { encCfg := app.MakeEncodingConfig() - chainID := fmt.Sprintf("chain_%d-1", tmrand.NewRand().Int()) + chainID := "chain-" + tmrand.NewRand().Str(6) return Config{ Codec: encCfg.Codec, TxConfig: encCfg.TxConfig,