Handle the delayed creation of the bootstrap node address file

This commit is contained in:
Zahary Karadjov 2020-06-11 16:31:35 +03:00 committed by zah
parent 9363169098
commit 5807e2a767
1 changed files with 4 additions and 2 deletions

View File

@ -143,6 +143,8 @@ $MAKE LOG_LEVEL="${LOG_LEVEL}" NIMFLAGS="-d:insecure -d:testnet_servers_image ${
--out-validators-dir="${DEPOSITS_DIR}" \ --out-validators-dir="${DEPOSITS_DIR}" \
--out-secrets-dir="${SECRETS_DIR}" --out-secrets-dir="${SECRETS_DIR}"
GENESIS_OFFSET=30
BOOTSTRAP_IP="127.0.0.1" BOOTSTRAP_IP="127.0.0.1"
./build/beacon_node createTestnet \ ./build/beacon_node createTestnet \
--data-dir="${DATA_DIR}/node0" \ --data-dir="${DATA_DIR}/node0" \
@ -153,7 +155,7 @@ BOOTSTRAP_IP="127.0.0.1"
--output-bootstrap-file="${NETWORK_DIR}/bootstrap_nodes.txt" \ --output-bootstrap-file="${NETWORK_DIR}/bootstrap_nodes.txt" \
--bootstrap-address=${BOOTSTRAP_IP} \ --bootstrap-address=${BOOTSTRAP_IP} \
--bootstrap-port=${BASE_PORT} \ --bootstrap-port=${BASE_PORT} \
--genesis-offset=60 # Delay in seconds --genesis-offset=${GENESIS_OFFSET} # Delay in seconds
./scripts/make_prometheus_config.sh \ ./scripts/make_prometheus_config.sh \
--nodes ${NUM_NODES} \ --nodes ${NUM_NODES} \
@ -195,7 +197,7 @@ for NUM_NODE in $(seq 0 $((NUM_NODES - 1))); do
while [ ! -f "${DATA_DIR}/node0/beacon_node.address" ]; do while [ ! -f "${DATA_DIR}/node0/beacon_node.address" ]; do
sleep 0.1 sleep 0.1
NOW_TIMESTAMP=$(date +%s) NOW_TIMESTAMP=$(date +%s)
if [[ "$(( NOW_TIMESTAMP - START_TIMESTAMP ))" -ge "$BOOTSTRAP_TIMEOUT" ]]; then if [[ "$(( NOW_TIMESTAMP - START_TIMESTAMP - GENESIS_OFFSET ))" -ge "$BOOTSTRAP_TIMEOUT" ]]; then
echo "Bootstrap node failed to start in ${BOOTSTRAP_TIMEOUT} seconds. Aborting." echo "Bootstrap node failed to start in ${BOOTSTRAP_TIMEOUT} seconds. Aborting."
dump_logs dump_logs
exit 1 exit 1