@ -0,0 +1,3 @@ | |||||
FROM tester | |||||
VOLUME /go/bin |
@ -0,0 +1,3 @@ | |||||
#! /bin/bash | |||||
docker build -t tester -f ./test/docker/Dockerfile . |
@ -0,0 +1,9 @@ | |||||
#! /bin/bash | |||||
# update the `tester` image by copying in the latest tendermint binary | |||||
docker run --name builder tester true | |||||
docker cp $GOPATH/bin/tendermint builder:/go/bin/tendermint | |||||
docker commit builder tester | |||||
docker rm -vf builder | |||||
@ -0,0 +1,8 @@ | |||||
#! /bin/bash | |||||
h1=10 | |||||
h2=0 | |||||
while [ $h2 -lt $(($h1+3)) ]; do | |||||
echo "$h2" | |||||
h2=$(($h2+1)) | |||||
done |
@ -1,4 +1,5 @@ | |||||
#! /bin/bash | #! /bin/bash | ||||
# clean everything | |||||
docker rm -vf $(docker ps -aq) | docker rm -vf $(docker ps -aq) | ||||
docker network rm local_testnet | docker network rm local_testnet |
@ -0,0 +1,44 @@ | |||||
#! /bin/bash | |||||
set -eu | |||||
set -o pipefail | |||||
############################################################### | |||||
# for each peer: | |||||
# kill peer | |||||
# bring it back online via fast sync | |||||
# check app hash | |||||
############################################################### | |||||
ID=$1 | |||||
addr=$(test/p2p/ip.sh $ID):46657 | |||||
peerID=$(( $(($ID % 4)) + 1 )) # 1->2 ... 3->4 ... 4->1 | |||||
peer_addr=$(test/p2p/ip.sh $peerID):46657 | |||||
# get another peer's height | |||||
h1=`curl -s $peer_addr/status | jq .result[1].latest_block_height` | |||||
# get another peer's state | |||||
root1=`curl -s $peer_addr/status | jq .result[1].latest_app_hash` | |||||
echo "Other peer is on height $h1 with state $root1" | |||||
echo "Waiting for peer $ID to catch up" | |||||
# wait for it to sync to past its previous height | |||||
set +e | |||||
set +o pipefail | |||||
h2="0" | |||||
while [[ "$h2" -lt "$(($h1+3))" ]]; do | |||||
sleep 1 | |||||
h2=`curl -s $addr/status | jq .result[1].latest_block_height` | |||||
echo "... $h2" | |||||
done | |||||
# check the app hash | |||||
root2=`curl -s $addr/status | jq .result[1].latest_app_hash` | |||||
if [[ "$root1" != "$root2" ]]; then | |||||
echo "App hash after fast sync does not match. Got $root2; expected $root1" | |||||
exit 1 | |||||
fi | |||||
echo "... fast sync successful" |
@ -0,0 +1,7 @@ | |||||
#! /bin/bash | |||||
set -eu | |||||
ID=$1 | |||||
echo "172.57.0.$((100+$ID))" | |||||
@ -0,0 +1,23 @@ | |||||
#! /bin/bash | |||||
set -eu | |||||
DOCKER_IMAGE=$1 | |||||
NETWORK_NAME=$2 | |||||
ID=$3 | |||||
set +u | |||||
SEEDS=$4 | |||||
set -u | |||||
if [[ "$SEEDS" != "" ]]; then | |||||
SEEDS=" --seeds $SEEDS " | |||||
fi | |||||
echo "starting tendermint peer ID=$ID" | |||||
# start tendermint container on the network | |||||
docker run -d \ | |||||
--net=$NETWORK_NAME \ | |||||
--ip=$(test/p2p/ip.sh $ID) \ | |||||
--name local_testnet_$ID \ | |||||
--entrypoint tendermint \ | |||||
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \ | |||||
$DOCKER_IMAGE node $SEEDS --proxy_app=dummy |