Restore the NODE_ID functionality and use the old data directories

This commit is contained in:
Zahary Karadjov 2020-11-10 10:11:13 +02:00
parent 52043a8fe7
commit 500301c6c7
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 11 additions and 1 deletions

View File

@ -23,6 +23,11 @@ HELP
exit 0
fi
: ${NODE_ID:=0}
: ${DATA_DIR_NAME:="shared_${NETWORK}_${NODE_ID}"}
: ${DATA_DIR:="build/data/${DATA_DIR_NAME}"}
: ${BASE_P2P_PORT:=9000}
: ${BASE_RPC_PORT:=9190}
# Windows detection
if uname | grep -qiE "mingw|msys"; then
@ -62,7 +67,12 @@ fi
build/${NBC_BINARY} \
--network=${NETWORK} \
--data-dir=build/data/${NETWORK} \
--data-dir="${DATA_DIR}" \
--log-file="${DATA_DIR}/nbc_bn_$(date +"%Y%m%d%H%M%S").log" \
--web3-url="${WEB3_URL}" \
--tcp-port=$(( ${BASE_P2P_PORT} + ${NODE_ID} )) \
--udp-port=$(( ${BASE_P2P_PORT} + ${NODE_ID} )) \
--rpc \
--rpc-port=$(( ${BASE_RPC_PORT} +${NODE_ID} )) \
$@