make nat setting optional when running sim

This commit is contained in:
Jacek Sieka 2019-03-19 12:57:57 -06:00
parent 6ec8ffe0ff
commit 71670ca9c9
No known key found for this signature in database
GPG Key ID: 6299FEB3EB6FA465
1 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,11 @@ DATA_DIR=$SIMULATION_DIR/node-${1}
V_PREFIX="$VALIDATORS_DIR/v$(printf '%06d' ${1})" V_PREFIX="$VALIDATORS_DIR/v$(printf '%06d' ${1})"
PORT=$(printf '5%04d' ${1}) PORT=$(printf '5%04d' ${1})
MYIP=$(curl -s ifconfig.me)
NAT_FLAG=""
if [ "${NAT:-}" == "1" ]; then
NAT_FLAG="--nat:extip:$(curl -s ifconfig.me)"
fi
$BEACON_NODE_BIN \ $BEACON_NODE_BIN \
--network:$NETWORK_METADATA_FILE \ --network:$NETWORK_METADATA_FILE \
@ -29,6 +33,6 @@ $BEACON_NODE_BIN \
--validator:${V_PREFIX}9.privkey \ --validator:${V_PREFIX}9.privkey \
--tcpPort:$PORT \ --tcpPort:$PORT \
--udpPort:$PORT \ --udpPort:$PORT \
--nat:extip:$MYIP \ $NAT_FLAG \
--stateSnapshot:$SNAPSHOT_FILE --stateSnapshot:$SNAPSHOT_FILE