fix private devnet with private ip (#879)

Co-authored-by: liam.lai <liam.lai@us>
This commit is contained in:
benjamin202410 2025-02-22 19:32:45 -08:00 committed by GitHub
parent 86e3dbb04d
commit 6217d1e3fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,24 +62,32 @@ fi
ws_port=8555
if test -z "$WS_PORT"
then
echo "WS_PORT not set, default to $ws_port"
echo "WS_PORT not set, default to $ws_port"
else
echo "WS_PORT found, set to $WS_PORT"
ws_port=$WS_PORT
fi
INSTANCE_IP=$(curl https://checkip.amazonaws.com)
netstats="${NODE_NAME}-${wallet}-${INSTANCE_IP}:xinfin_xdpos_hybrid_network_stats@devnetstats.hashlabs.apothem.network:1999"
instance_ip=$(ifconfig eth0 | awk '/inet addr:/ {print $2}' | cut -d: -f2)
if test -z "$INSTANCE_IP"
then
echo "INSTANCE_IP not set, default to $instance_ip"
else
echo "INSTANCE_IP found, set to $INSTANCE_IP"
instance_ip=$INSTANCE_IP
fi
netstats="${NODE_NAME}-${wallet}-${instance_ip}:xinfin_xdpos_hybrid_network_stats@devnetstats.hashlabs.apothem.network:1999"
echo "Running a node with wallet: ${wallet} at IP: ${INSTANCE_IP}"
echo "Running a node with wallet: ${wallet} at IP: ${instance_ip}"
echo "Starting nodes with $bootnodes ..."
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
# https://github.com/XinFinOrg/XDPoSChain/issues/268
XDC --ethstats ${netstats} --gcmode archive \
--nat extip:${INSTANCE_IP} \
--nat extip:${instance_ip} \
--bootnodes ${bootnodes} --syncmode full \
--datadir /work/xdcchain --networkid 551 \
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \