difftreelog
limited the execution of the wait_for_first_block script to 100 cycles
in: master
1 file changed
js-packages/scripts/generate_types/wait_for_first_block.shdiffbeforeafterboth1#!/usr/bin/env bash23DIR=dirname"$0"45. "$DIR/functions.sh"67last_block_id=08block_id=09counter=010function get_block {11 block_id_hex=do_rpc|jq-r12 block_id=$((block_id_hex))13 echo Id = $block_id14}1516function had_new_block {17 last_block_id=$block_id18 get_block19 if (( last_block_id != 0 && block_id > last_block_id )); then20 return 021 fi22 return 123}2425function reset_check {26 last_block_id=027 block_id=028 counter=029}3031while [ ! had_new_block ] && [ $counter -lt 100 ]; do32 echo "Waiting for next block..."33 counter=$((counter+1))34 sleep 1235done3637reset_check3839echo "Chain is running, but lets wait for another block after a minute, to avoid startup flakiness."40sleep 604142while ! had_new_block; do43 echo "Waiting for another block..."44 sleep 1245done4647echo "Chain is running!"