Enable RPC port in general scenarios (#7177)
This commit is contained in:
parent
8c5bcb7487
commit
776c7c7cd2
|
@ -31,12 +31,15 @@ fi
|
||||||
: "${TRACING_ENDPOINT_PORT:=3000}"
|
: "${TRACING_ENDPOINT_PORT:=3000}"
|
||||||
# [rpc]
|
# [rpc]
|
||||||
: "${RPC_LISTEN_ADDR:=0.0.0.0}"
|
: "${RPC_LISTEN_ADDR:=0.0.0.0}"
|
||||||
|
if [[ -z "${RPC_PORT}" ]]; then
|
||||||
|
if [[ " ${FEATURES} " =~ " getblocktemplate-rpcs " ]]; then
|
||||||
if [[ "${NETWORK}" = "Mainnet" ]]; then
|
if [[ "${NETWORK}" = "Mainnet" ]]; then
|
||||||
: "${RPC_PORT:=8232}"
|
: "${RPC_PORT:=8232}"
|
||||||
elif [[ "${NETWORK}" = "Testnet" ]]; then
|
elif [[ "${NETWORK}" = "Testnet" ]]; then
|
||||||
: "${RPC_PORT:=18232}"
|
: "${RPC_PORT:=18232}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Populate `zebrad.toml` before starting zebrad, using the environmental
|
# 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.
|
# 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
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set this to enable the RPC port
|
if [[ "${RPC_PORT}" ]]; then
|
||||||
if [[ " $FEATURES " =~ " getblocktemplate-rpcs " ]]; then # spaces are important here to avoid partial matches
|
cat <<EOF >> "${ZEBRA_CONF_PATH}"
|
||||||
cat <<EOF >> "$ZEBRA_CONF_PATH"
|
|
||||||
[rpc]
|
[rpc]
|
||||||
listen_addr = "${RPC_LISTEN_ADDR}:${RPC_PORT}"
|
listen_addr = "${RPC_LISTEN_ADDR}:${RPC_PORT}"
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in New Issue