You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
848 B

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