Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nethermind/nethermind-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ METRICS_PORT="${METRICS_PORT:-6060}"
DISCOVERY_PORT="${DISCOVERY_PORT:-30303}"
P2P_PORT="${P2P_PORT:-30303}"
ADDITIONAL_ARGS=""
HOST_IP="${HOST_IP:-}" # Optional: set to your public IP for P2P peer discovery behind NAT

# Check if required variables are set
if [[ -z "$OP_NODE_NETWORK" ]]; then
Expand Down Expand Up @@ -42,6 +43,11 @@ if [[ -n "${OP_NETHERMIND_ETHSTATS_ENDPOINT:-}" ]]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --EthStats.NodeName=${OP_NETHERMIND_ETHSTATS_NODE_NAME:-NethermindNode} --EthStats.Endpoint=$OP_NETHERMIND_ETHSTATS_ENDPOINT"
fi

# Advertise public IP for better P2P peer discovery behind NAT
if [[ -n "$HOST_IP" ]]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --Network.ExternalIp=$HOST_IP"
fi

# Execute Nethermind
exec ./nethermind \
--config="$OP_NODE_NETWORK" \
Expand Down