tendermint/test/p2p/fast_sync/test_peer.sh

39 lines
885 B
Bash
Raw Normal View History

2016-12-12 13:00:21 -08:00
#! /bin/bash
set -eu
DOCKER_IMAGE=$1
NETWORK_NAME=$2
2016-12-20 07:28:41 -08:00
ID=$3
2016-12-12 13:00:21 -08:00
N=$4
PROXY_APP=$5
2016-12-12 13:00:21 -08:00
###############################################################
# this runs on each peer:
# kill peer
# bring it back online via fast sync
# wait for it to sync and check the app hash
###############################################################
2016-12-20 07:28:41 -08:00
echo "Testing fastsync on node $ID"
2016-12-12 13:00:21 -08:00
2016-12-20 07:25:47 -08:00
# kill peer
2016-12-12 13:00:21 -08:00
set +e # circle sigh :(
2016-12-20 07:28:41 -08:00
docker rm -vf local_testnet_$ID
2016-12-20 07:25:47 -08:00
set -e
2016-12-12 13:00:21 -08:00
# restart peer - should have an empty blockchain
SEEDS="$(test/p2p/ip.sh 1):46656"
for j in `seq 2 $N`; do
SEEDS="$SEEDS,$(test/p2p/ip.sh $j):46656"
done
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $PROXY_APP "--p2p.seeds $SEEDS --p2p.pex --rpc.unsafe"
2016-12-12 13:00:21 -08:00
# wait for peer to sync and check the app hash
2016-12-20 07:28:41 -08:00
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME fs_$ID "test/p2p/fast_sync/check_peer.sh $ID"
2016-12-12 13:00:21 -08:00
echo ""
echo "PASS"
echo ""