From ae3e9a9527d000e6182fd776cf73dfb3f64a48db Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 8 Apr 2022 18:29:00 +0900 Subject: [PATCH 1/2] set grpc-web port --- init_node.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init_node.sh b/init_node.sh index 0d93ec4e9e..8939c232dd 100644 --- a/init_node.sh +++ b/init_node.sh @@ -94,6 +94,7 @@ RPC_PORT=26657 P2P_PORT=26656 PROF_PORT=6060 GRPC_PORT=9090 +GRPC_WEB_PORT=9091 # Set genesis file and config(port, peer, ...) CHAIN_0_DIR="${CHAIN_DIR_PREFIX}0" @@ -126,6 +127,7 @@ for ((i = 0; i < N; i++)) sed -i 's#'"${MEMO}"'#'"${MEMO_SPLIT[1]}"':'"${P2P_PORT}"'#g' ${CHAIN_0_DIR}/config/config.toml # change port of persistent_peers sed -i 's/pruning = "default"/pruning = "nothing"/g' ${CHAIN_DIR}/config/app.toml + sed -i 's#"0.0.0.0:9091"#"0.0.0.0:'"${GRPC_WEB_PORT}"'"#g' ${CHAIN_DIR}/config/app.toml sed -i 's#"0.0.0.0:9090"#"0.0.0.0:'"${GRPC_PORT}"'"#g' ${CHAIN_DIR}/config/app.toml else sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"${RPC_PORT}"'"#g' ${CHAIN_DIR}/config/config.toml @@ -139,6 +141,7 @@ for ((i = 0; i < N; i++)) sed -i '' 's#'"${MEMO}"'#'"${MEMO_SPLIT[1]}"':'"${P2P_PORT}"'#g' ${CHAIN_0_DIR}/config/config.toml # change port of persistent_peers sed -i '' 's/pruning = "default"/pruning = "nothing"/g' ${CHAIN_DIR}/config/app.toml + sed -i '' 's#"0.0.0.0:9091"#"0.0.0.0:'"${GRPC_WEB_PORT}"'"#g' ${CHAIN_DIR}/config/app.toml sed -i '' 's#"0.0.0.0:9090"#"0.0.0.0:'"${GRPC_PORT}"'"#g' ${CHAIN_DIR}/config/app.toml fi @@ -146,6 +149,7 @@ for ((i = 0; i < N; i++)) RPC_PORT=`expr ${RPC_PORT} + 2` P2P_PORT=`expr ${P2P_PORT} + 2` PROF_PORT=`expr ${PROF_PORT} + 1` - GRPC_PORT=`expr ${GRPC_PORT} + 1` + GRPC_PORT=`expr ${GRPC_PORT} + 2` + GRPC_WEB_PORT=`expr ${GRPC_WEB_PORT} + 2` done From ff9e05a37a04b88862539160c6d525ff9ce59adf Mon Sep 17 00:00:00 2001 From: dudong2 Date: Tue, 12 Apr 2022 15:15:40 +0900 Subject: [PATCH 2/2] print grpc-web port to log --- init_node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init_node.sh b/init_node.sh index 8939c232dd..a193cc9e55 100644 --- a/init_node.sh +++ b/init_node.sh @@ -145,7 +145,7 @@ for ((i = 0; i < N; i++)) sed -i '' 's#"0.0.0.0:9090"#"0.0.0.0:'"${GRPC_PORT}"'"#g' ${CHAIN_DIR}/config/app.toml fi - echo "${BINARY} instance: home ${CHAIN_DIR} | chain-id ${CHAIN_ID} | p2p=:${P2P_PORT} | rpc=:${RPC_PORT} | profiling=:${PROF_PORT} | grpc=:${GRPC_PORT}" + echo "${BINARY} instance: home ${CHAIN_DIR} | chain-id ${CHAIN_ID} | p2p=:${P2P_PORT} | rpc=:${RPC_PORT} | profiling=:${PROF_PORT} | grpc=:${GRPC_PORT} | grpc-web=:${GRPC_WEB_PORT}" RPC_PORT=`expr ${RPC_PORT} + 2` P2P_PORT=`expr ${P2P_PORT} + 2` PROF_PORT=`expr ${PROF_PORT} + 1`