github.com/aergoio/aergo@v1.3.1/consensus/impl/raftv2/test/make_node.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  source set_test_env.sh
     4  source test_common.sh
     5  
     6  kill_svr.sh
     7  
     8  if [ "$TEST_SKIP_GENESIS" = "1" ];then
     9  	echo "================ skip init genesis node and reboot aergosvr ============="
    10  	if [ ! -e $TEST_RAFT_INSTANCE/BP11001.toml ];then
    11  		echo "not exist BP11001.toml"
    12  		exit 100
    13  	fi
    14  
    15  	run_svr.sh
    16  
    17  	WaitPeerConnect 2 60
    18  	if [ $? -ne 1 ];then
    19  		echo "failed to connect peer of $file for 60 sec. "
    20  		exit 100
    21  	fi
    22  	exit 0
    23  else
    24  	prepareConfig 3
    25  fi
    26  
    27  pushd $TEST_RAFT_INSTANCE
    28  
    29  clean.sh
    30  rm init_*.log
    31  
    32  
    33  if [ $# != 0 ]; then
    34      echo "Usage: $0"
    35      exit 100
    36  fi
    37  
    38  
    39  rm -rf genesis
    40  rm -f genesis.json
    41  
    42  for file in BP*.toml; do
    43      bpname=${file%%.toml}
    44      echo "./init_genesis.sh $bpname"
    45  #init_genesis.sh $bpname > /dev/null 2>&1
    46      init_genesis.sh $bpname 
    47  done
    48  
    49  if [ "$TEST_NOWAIT_PEER" != "1" ];then
    50  	WaitPeerConnect 2 60
    51  	if [ $? -ne 1 ];then
    52  		echo "failed to connect peer of $file for 60 sec. "
    53  		exit 100
    54  	fi
    55  fi
    56  
    57  popd