github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/test/p2p/fast_sync/test_peer.sh (about)

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