diff --git a/CHANGELOG.md b/CHANGELOG.md index dfcf2c1fcd..4559d83854 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (rpc) [#1611](https://github.com/evmos/ethermint/pull/1611) Add missing next fee in fee history, fix wrong oldestBlock and align earliest input as ethereum. +* (rpc) [#1613](https://github.com/evmos/ethermint/pull/1613) Change the default json-rpc listen address to localhost. * (rpc) [#1688](https://github.com/evmos/ethermint/pull/1688) Align filter rule for `debug_traceBlockByNumber` ### Improvements diff --git a/scripts/contract-test.sh b/scripts/contract-test.sh index 951a4c20a4..807d26f5bb 100755 --- a/scripts/contract-test.sh +++ b/scripts/contract-test.sh @@ -35,7 +35,7 @@ cat $HOME/.ethermint/config/genesis.json | jq '.app_state["mint"]["params"]["min "$PWD"/build/ethermintd validate-genesis # Start the node (remove the --pruning=nothing flag if historical queries are not needed) in background and log to file -"$PWD"/build/ethermintd start --pruning=nothing --rpc.unsafe --json-rpc.address="0.0.0.0:8545" --keyring-backend test > ethermintd.log 2>&1 & +"$PWD"/build/ethermintd start --pruning=nothing --rpc.unsafe --json-rpc.address="127.0.0.1:8545" --keyring-backend test > ethermintd.log 2>&1 & # Give ethermintd node enough time to launch sleep 5 diff --git a/scripts/ethermint-devnet.yaml b/scripts/ethermint-devnet.yaml index a6f7707611..5716821f05 100755 --- a/scripts/ethermint-devnet.yaml +++ b/scripts/ethermint-devnet.yaml @@ -7,8 +7,8 @@ ethermint_9000-1: index-events: - ethereum_tx.ethereumTxHash json-rpc: - address: "0.0.0.0:{EVMRPC_PORT}" - ws-address: "0.0.0.0:{EVMRPC_PORT_WS}" + address: "127.0.0.1:{EVMRPC_PORT}" + ws-address: "127.0.0.1:{EVMRPC_PORT_WS}" api: "eth,net,web3,debug" validators: - coins: 1000000000000000000stake,10000000000000000000000aphoton diff --git a/scripts/integration-test-all.sh b/scripts/integration-test-all.sh index 31450eb2bb..f4242edc89 100755 --- a/scripts/integration-test-all.sh +++ b/scripts/integration-test-all.sh @@ -16,7 +16,7 @@ REMOVE_DATA_DIR=false RPC_PORT="854" # Ethereum JSONRPC Websocket WS_PORT="855" -IP_ADDR="0.0.0.0" +IP_ADDR="127.0.0.1" KEY="mykey" CHAINID="ethermint_9000-1" diff --git a/scripts/start.sh b/scripts/start.sh index c05bff709e..65c3e14bcc 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -11,7 +11,7 @@ TEST_QTD=1 #PORT AND RPC_PORT 3 initial digits, to be concat with a suffix later when node is initialized RPC_PORT="854" -IP_ADDR="0.0.0.0" +IP_ADDR="127.0.0.1" MODE="rpc" KEY="mykey" diff --git a/server/config/config.go b/server/config/config.go index 20027f34af..656235e715 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -20,13 +20,13 @@ const ( DefaultGRPCAddress = "0.0.0.0:9900" // DefaultJSONRPCAddress is the default address the JSON-RPC server binds to. - DefaultJSONRPCAddress = "0.0.0.0:8545" + DefaultJSONRPCAddress = "127.0.0.1:8545" // DefaultJSONRPCWsAddress is the default address the JSON-RPC WebSocket server binds to. - DefaultJSONRPCWsAddress = "0.0.0.0:8546" + DefaultJSONRPCWsAddress = "127.0.0.1:8546" // DefaultJsonRPCMetricsAddress is the default address the JSON-RPC Metrics server binds to. - DefaultJSONRPCMetricsAddress = "0.0.0.0:6065" + DefaultJSONRPCMetricsAddress = "127.0.0.1:6065" // DefaultEVMTracer is the default vm.Tracer type DefaultEVMTracer = "" diff --git a/tests/integration_tests/configs/default.jsonnet b/tests/integration_tests/configs/default.jsonnet index 349be756f4..a8425405ca 100644 --- a/tests/integration_tests/configs/default.jsonnet +++ b/tests/integration_tests/configs/default.jsonnet @@ -13,8 +13,8 @@ 'minimum-gas-prices': '0aphoton', 'index-events': ['ethereum_tx.ethereumTxHash'], 'json-rpc': { - address: '0.0.0.0:{EVMRPC_PORT}', - 'ws-address': '0.0.0.0:{EVMRPC_PORT_WS}', + address: '127.0.0.1:{EVMRPC_PORT}', + 'ws-address': '127.0.0.1:{EVMRPC_PORT_WS}', api: 'eth,net,web3,debug', 'feehistory-cap': 100, 'block-range-cap': 10000, diff --git a/testutil/network/network.go b/testutil/network/network.go index 8bb9512c67..706cc26ae8 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -317,7 +317,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { if err != nil { return nil, err } - appCfg.JSONRPC.Address = fmt.Sprintf("0.0.0.0:%s", jsonRPCPort) + appCfg.JSONRPC.Address = fmt.Sprintf("127.0.0.1:%s", jsonRPCPort) } appCfg.JSONRPC.Enable = true appCfg.JSONRPC.API = config.GetAPINamespaces()