From a7194871ad89830aaadf100592f6190720d43b3e Mon Sep 17 00:00:00 2001 From: faisalnugroho Date: Sat, 30 May 2026 12:57:39 +0800 Subject: [PATCH] fix(entrypoint): respect operator-provided P2P_ADVERTISE_IP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The consensus-entrypoint script always calls get_public_ip() and exports the result as BASE_NODE_P2P_ADVERTISE_IP, overriding any value the operator already set in their env file. This is a problem for operators running behind NAT or in restricted networks where the external IP services are unreachable — the script exits with code 8 and the node won't start, even though the operator already knows their public IP and configured it. Now checks if BASE_NODE_P2P_ADVERTISE_IP is already set before attempting discovery. If the operator provided a value, it's used as-is. Discovery only runs as a fallback. Refs #1107 --- consensus-entrypoint | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/consensus-entrypoint b/consensus-entrypoint index 05b89467a..2c4a45628 100755 --- a/consensus-entrypoint +++ b/consensus-entrypoint @@ -46,13 +46,15 @@ until [ "$(curl -s --max-time 10 --connect-timeout 5 -w '%{http_code}' -o /dev/n sleep 5 done -if PUBLIC_IP=$(get_public_ip); then +if [[ -n "${BASE_NODE_P2P_ADVERTISE_IP:-}" ]]; then + echo "Using operator-provided BASE_NODE_P2P_ADVERTISE_IP: $BASE_NODE_P2P_ADVERTISE_IP" +elif PUBLIC_IP=$(get_public_ip); then echo "fetched public IP is: $PUBLIC_IP" + export BASE_NODE_P2P_ADVERTISE_IP=$PUBLIC_IP else echo "Could not retrieve public IP." exit 8 fi -export BASE_NODE_P2P_ADVERTISE_IP=$PUBLIC_IP echo "$BASE_NODE_L2_ENGINE_AUTH_RAW" > "$BASE_NODE_L2_ENGINE_AUTH"