From 776c7c7cd2b18b96027c23a3bc73f203b2b288b9 Mon Sep 17 00:00:00 2001 From: Marek Date: Mon, 10 Jul 2023 08:07:32 +0200 Subject: [PATCH] Enable RPC port in general scenarios (#7177) --- docker/runtime-entrypoint.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/runtime-entrypoint.sh b/docker/runtime-entrypoint.sh index 596cef19a..b5c58f2c6 100755 --- a/docker/runtime-entrypoint.sh +++ b/docker/runtime-entrypoint.sh @@ -31,12 +31,15 @@ fi : "${TRACING_ENDPOINT_PORT:=3000}" # [rpc] : "${RPC_LISTEN_ADDR:=0.0.0.0}" +if [[ -z "${RPC_PORT}" ]]; then +if [[ " ${FEATURES} " =~ " getblocktemplate-rpcs " ]]; then if [[ "${NETWORK}" = "Mainnet" ]]; then : "${RPC_PORT:=8232}" elif [[ "${NETWORK}" = "Testnet" ]]; then : "${RPC_PORT:=18232}" fi - +fi +fi # Populate `zebrad.toml` before starting zebrad, using the environmental # variables set by the Dockerfile or the user. If the user has already created a config, don't replace it. @@ -65,9 +68,8 @@ endpoint_addr = "${METRICS_ENDPOINT_ADDR}:${METRICS_ENDPOINT_PORT}" EOF fi -# Set this to enable the RPC port -if [[ " $FEATURES " =~ " getblocktemplate-rpcs " ]]; then # spaces are important here to avoid partial matches -cat <> "$ZEBRA_CONF_PATH" +if [[ "${RPC_PORT}" ]]; then +cat <> "${ZEBRA_CONF_PATH}" [rpc] listen_addr = "${RPC_LISTEN_ADDR}:${RPC_PORT}" EOF