github.com/evdatsion/aphelion-dpos-bft@v0.32.1/test/p2p/fast_sync/test_peer.sh (about) 1 #! /bin/bash 2 set -eu 3 4 DOCKER_IMAGE=$1 5 NETWORK_NAME=$2 6 ID=$3 7 N=$4 8 PROXY_APP=$5 9 10 ############################################################### 11 # this runs on each peer: 12 # kill peer 13 # bring it back online via fast sync 14 # wait for it to sync and check the app hash 15 ############################################################### 16 17 18 echo "Testing fastsync on node $ID" 19 20 # kill peer 21 set +e # circle sigh :( 22 docker rm -vf local_testnet_$ID 23 set -e 24 25 # restart peer - should have an empty blockchain 26 PERSISTENT_PEERS="$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):26656" 27 for j in `seq 2 $N`; do 28 PERSISTENT_PEERS="$PERSISTENT_PEERS,$(test/p2p/ip_plus_id.sh $j $DOCKER_IMAGE):26656" 29 done 30 bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $PROXY_APP "--p2p.persistent_peers $PERSISTENT_PEERS --p2p.pex --rpc.unsafe" 31 32 # wait for peer to sync and check the app hash 33 bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME fs_$ID "test/p2p/fast_sync/check_peer.sh $ID" 34 35 echo "" 36 echo "PASS" 37 echo "" 38