@ -0,0 +1,7 @@ | |||
#! /bin/bash | |||
set -euo pipefail | |||
GLIDE=$1 | |||
LIB=$2 | |||
cat $GLIDE | grep -A1 $LIB | grep -v $LIB | awk '{print $2}' |
@ -0,0 +1,11 @@ | |||
#! /bin/bash | |||
go get github.com/tendermint/tmsp/... | |||
COMMIT=`bash scripts/glide/parse.sh $(pwd)/glide.lock tmsp` | |||
cd $GOPATH/src/github.com/tendermint/tmsp | |||
git checkout $COMMIT | |||
go install ./cmd/... | |||
@ -1,7 +1,23 @@ | |||
# Pull base image. | |||
FROM golang:1.6 | |||
# Grab deps (jq, hexdump) | |||
RUN apt-get update && \ | |||
apt-get install -y --no-install-recommends \ | |||
jq bsdmainutils && \ | |||
rm -rf /var/lib/apt/lists/* | |||
ENV TENDERMINT_ORG $GOPATH/src/github.com/tendermint/ | |||
RUN mkdir -p $TENDERMINT_ORG | |||
COPY . $TENDERMINT_ORG/tendermint | |||
WORKDIR $TENDERMINT_ORG/tendermint | |||
RUN make get_vendor_deps | |||
RUN go install ./cmd/tendermint | |||
RUN bash scripts/install_tmsp_apps.sh | |||
EXPOSE 46656 | |||
EXPOSE 46657 |
@ -0,0 +1,4 @@ | |||
#! /bin/bash | |||
docker rm -vf $(docker ps -aq) | |||
docker network rm local_testnet |
@ -0,0 +1,9 @@ | |||
#! /bin/bash | |||
# This is a sample bash script for a TMSP application | |||
cd app/ | |||
git clone https://github.com/tendermint/nomnomcoin.git | |||
cd nomnomcoin | |||
npm install . | |||
node app.js --eyes="unix:///data/tendermint/data/data.sock" |
@ -0,0 +1,53 @@ | |||
{ | |||
"id": "", | |||
"val_set_id": "anon", | |||
"validators": [ | |||
{ | |||
"validator": { | |||
"id": "mach1", | |||
"pub_key": [ | |||
1, | |||
"BE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
] | |||
}, | |||
"p2p_addr": "", | |||
"rpc_addr": "" | |||
}, | |||
{ | |||
"validator": { | |||
"id": "mach2", | |||
"pub_key": [ | |||
1, | |||
"6DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
] | |||
}, | |||
"p2p_addr": "", | |||
"rpc_addr": "", | |||
"index": 1 | |||
}, | |||
{ | |||
"validator": { | |||
"id": "mach3", | |||
"pub_key": [ | |||
1, | |||
"AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
] | |||
}, | |||
"p2p_addr": "", | |||
"rpc_addr": "", | |||
"index": 2 | |||
}, | |||
{ | |||
"validator": { | |||
"id": "mach4", | |||
"pub_key": [ | |||
1, | |||
"9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
] | |||
}, | |||
"p2p_addr": "", | |||
"rpc_addr": "", | |||
"index": 3 | |||
} | |||
] | |||
} |
@ -0,0 +1,20 @@ | |||
#! /bin/bash | |||
# This is a sample bash script for tendermint core | |||
# Edit this script before "mintnet start" to change | |||
# the core blockchain engine. | |||
TMREPO="github.com/tendermint/tendermint" | |||
BRANCH="master" | |||
go get -d $TMREPO/cmd/tendermint | |||
### DEPENDENCIES (example) | |||
# cd $GOPATH/src/github.com/tendermint/tmsp | |||
# git fetch origin $BRANCH | |||
# git checkout $BRANCH | |||
### DEPENDENCIES END | |||
cd $GOPATH/src/$TMREPO | |||
git fetch origin $BRANCH | |||
git checkout $BRANCH | |||
make install | |||
tendermint node --seeds="$TMSEEDS" --moniker="$TMNAME" --proxy_app="$PROXYAPP" |
@ -0,0 +1,7 @@ | |||
#! /bin/bash | |||
# This is a sample bash script for MerkleEyes. | |||
# NOTE: mintnet expects data.sock to be created | |||
go get github.com/tendermint/merkleeyes/cmd/merkleeyes | |||
merkleeyes server --address="unix:///data/tendermint/data/data.sock" |
@ -0,0 +1,39 @@ | |||
{ | |||
"app_hash": "", | |||
"chain_id": "chain-9ujDWI", | |||
"genesis_time": "2016-06-24T20:01:19.322Z", | |||
"validators": [ | |||
{ | |||
"amount": 1, | |||
"name": "mach1", | |||
"pub_key": [ | |||
1, | |||
"BE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach2", | |||
"pub_key": [ | |||
1, | |||
"6DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach3", | |||
"pub_key": [ | |||
1, | |||
"AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach4", | |||
"pub_key": [ | |||
1, | |||
"9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
] | |||
} | |||
] | |||
} |
@ -0,0 +1,14 @@ | |||
{ | |||
"address": "0E6925C3EE4C599DFF1536A5071AF4A26DF33635", | |||
"last_height": 0, | |||
"last_round": 0, | |||
"last_step": 0, | |||
"priv_key": [ | |||
1, | |||
"547AA07C7A8CE16C5CB2A40C6C26D15B0A32960410A9F1EA6E50B636F1AB389ABE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
], | |||
"pub_key": [ | |||
1, | |||
"BE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
] | |||
} |
@ -0,0 +1,39 @@ | |||
{ | |||
"app_hash": "", | |||
"chain_id": "chain-9ujDWI", | |||
"genesis_time": "2016-06-24T20:01:19.322Z", | |||
"validators": [ | |||
{ | |||
"amount": 1, | |||
"name": "mach1", | |||
"pub_key": [ | |||
1, | |||
"BE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach2", | |||
"pub_key": [ | |||
1, | |||
"6DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach3", | |||
"pub_key": [ | |||
1, | |||
"AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach4", | |||
"pub_key": [ | |||
1, | |||
"9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
] | |||
} | |||
] | |||
} |
@ -0,0 +1,14 @@ | |||
{ | |||
"address": "99DBBD2AFC28FB5BAC5574AFAF0D9C806CED3B55", | |||
"last_height": 0, | |||
"last_round": 0, | |||
"last_step": 0, | |||
"priv_key": [ | |||
1, | |||
"D047889E60502FC3129D0AB7F334B1838ED9ED1ECD99CBB96B71AD5ABF5A81436DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
], | |||
"pub_key": [ | |||
1, | |||
"6DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
] | |||
} |
@ -0,0 +1,39 @@ | |||
{ | |||
"app_hash": "", | |||
"chain_id": "chain-9ujDWI", | |||
"genesis_time": "2016-06-24T20:01:19.322Z", | |||
"validators": [ | |||
{ | |||
"amount": 1, | |||
"name": "mach1", | |||
"pub_key": [ | |||
1, | |||
"BE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach2", | |||
"pub_key": [ | |||
1, | |||
"6DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach3", | |||
"pub_key": [ | |||
1, | |||
"AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach4", | |||
"pub_key": [ | |||
1, | |||
"9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
] | |||
} | |||
] | |||
} |
@ -0,0 +1,14 @@ | |||
{ | |||
"address": "4C5F061DAC28660853904A66705B12CA2B317572", | |||
"last_height": 0, | |||
"last_round": 0, | |||
"last_step": 0, | |||
"priv_key": [ | |||
1, | |||
"C1A4E47F349FC5F556F4A9A27BA776B94424C312BAA6CF6EE44B867348D7C3F2AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
], | |||
"pub_key": [ | |||
1, | |||
"AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
] | |||
} |
@ -0,0 +1,39 @@ | |||
{ | |||
"app_hash": "", | |||
"chain_id": "chain-9ujDWI", | |||
"genesis_time": "2016-06-24T20:01:19.322Z", | |||
"validators": [ | |||
{ | |||
"amount": 1, | |||
"name": "mach1", | |||
"pub_key": [ | |||
1, | |||
"BE8933DFF1600C026E34718F1785A4CDEAB90C35698B394E38B6947AE91DE116" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach2", | |||
"pub_key": [ | |||
1, | |||
"6DC534465323126587D2A2A93B59D689B717073B1DE968A25A6EF13D595318AD" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach3", | |||
"pub_key": [ | |||
1, | |||
"AE67AC697D135AA0B4601EA57EAAB3FEBF4BAA4F229C45A598C2985B12FCD1A1" | |||
] | |||
}, | |||
{ | |||
"amount": 1, | |||
"name": "mach4", | |||
"pub_key": [ | |||
1, | |||
"9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
] | |||
} | |||
] | |||
} |
@ -0,0 +1,14 @@ | |||
{ | |||
"address": "86F6DA4B34F16D743D2D992B5ACB12F5E724CC2D", | |||
"last_height": 0, | |||
"last_round": 0, | |||
"last_step": 0, | |||
"priv_key": [ | |||
1, | |||
"C4CC3ED28F020C2DBDA98BCDBF08C3CED370470E74F25E938D5D295E8E3D2B0C9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
], | |||
"pub_key": [ | |||
1, | |||
"9EBC8F58CED4B46DCD5AB8ABA591DD253CD7CB5037273FDA32BC0B6461C4EFD9" | |||
] | |||
} |
@ -0,0 +1,28 @@ | |||
#! /bin/bash | |||
set -eu | |||
DOCKER_IMAGE=$1 | |||
NETWORK_NAME=$2 | |||
cd $GOPATH/src/github.com/tendermint/tendermint | |||
# create docker network | |||
docker network create --driver bridge --subnet 172.57.0.0/16 $NETWORK_NAME | |||
N=4 | |||
seeds="172.57.0.101:46656" | |||
for i in `seq 2 $N`; do | |||
seeds="$seeds,172.57.0.$((100+$i)):46656" | |||
done | |||
echo "Seeds: $seeds" | |||
for i in `seq 1 $N`; do | |||
# start tendermint container | |||
docker run -d \ | |||
--net=$NETWORK_NAME \ | |||
--ip=172.57.0.$((100+$i)) \ | |||
--name local_testnet_$i \ | |||
--entrypoint tendermint \ | |||
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$i/core \ | |||
$DOCKER_IMAGE node --seeds $seeds --proxy_app=dummy | |||
done |
@ -0,0 +1,79 @@ | |||
#! /bin/bash | |||
# wait for everyone to come online | |||
echo "Waiting for nodes to come online" | |||
for i in `seq 1 4`; do | |||
addr="172.57.0.$((100+$i)):46657" | |||
curl -s $addr/status > /dev/null | |||
ERR=$? | |||
while [ "$ERR" != 0 ]; do | |||
sleep 1 | |||
curl -s $addr/status > /dev/null | |||
ERR=$? | |||
done | |||
echo "... node $i is up" | |||
done | |||
echo "" | |||
# run the test on each of them | |||
for i in `seq 1 4`; do | |||
addr="172.57.0.$((100+$i)):46657" | |||
# - assert everyone has 3 other peers | |||
N_PEERS=`curl -s $addr/net_info | jq '.result[1].peers | length'` | |||
while [ "$N_PEERS" != 3 ]; do | |||
echo "Waiting for node $i to connect to all peers ..." | |||
sleep 1 | |||
N_PEERS=`curl -s $addr/net_info | jq '.result[1].peers | length'` | |||
done | |||
# - assert block height is greater than 1 | |||
BLOCK_HEIGHT=`curl -s $addr/status | jq .result[1].latest_block_height` | |||
while [ "$BLOCK_HEIGHT" -le 1 ]; do | |||
echo "Waiting for node $i to commit a block ..." | |||
sleep 1 | |||
BLOCK_HEIGHT=`curl -s $addr/status | jq .result[1].latest_block_height` | |||
done | |||
echo "Node $i is connected to all peers and at block $BLOCK_HEIGHT" | |||
# current state | |||
HASH1=`curl -s $addr/status | jq .result[1].latest_app_hash` | |||
# - send a tx | |||
TX=\"aadeadbeefbeefbeef0$i\" | |||
echo "Broadcast Tx $TX" | |||
curl -s $addr/broadcast_tx_commit?tx=$TX | |||
echo "" | |||
# we need to wait another block to get the new app_hash | |||
h1=`curl -s $addr/status | jq .result[1].latest_block_height` | |||
h2=$h1 | |||
while [ "$h2" == "$h1" ]; do | |||
sleep 1 | |||
h2=`curl -s $addr/status | jq .result[1].latest_block_height` | |||
done | |||
# check that hash was updated | |||
HASH2=`curl -s $addr/status | jq .result[1].latest_app_hash` | |||
if [[ "$HASH1" == "$HASH2" ]]; then | |||
echo "Expected state hash to update from $HASH1. Got $HASH2" | |||
exit 1 | |||
fi | |||
# check we get the same new hash on all other nodes | |||
for j in `seq 1 4`; do | |||
if [[ "$i" != "$j" ]]; then | |||
HASH3=`curl -s 172.57.0.$((100+$j)):46657/status | jq .result[1].latest_app_hash` | |||
if [[ "$HASH2" != "$HASH3" ]]; then | |||
echo "App hash for node $j doesn't match. Got $HASH3, expected $HASH2" | |||
exit 1 | |||
fi | |||
fi | |||
done | |||
echo "All nodes are up to date" | |||
done | |||
echo "" | |||
echo "PASS" |
@ -0,0 +1,10 @@ | |||
#! /bin/bash | |||
DOCKER_IMAGE=$1 | |||
NETWORK_NAME=local_testnet | |||
# start the testnet on a local network | |||
bash test/p2p/local_testnet.sh $DOCKER_IMAGE $NETWORK_NAME | |||
# run the test | |||
bash test/p2p/test_client.sh $DOCKER_IMAGE $NETWORK_NAME test/p2p/run_test.sh |
@ -0,0 +1,16 @@ | |||
#! /bin/bash | |||
set -eu | |||
DOCKER_IMAGE=$1 | |||
NETWORK_NAME=$2 | |||
CMD=$3 | |||
# run the test container on the local network | |||
docker run -t \ | |||
--rm \ | |||
-v $GOPATH/src/github.com/tendermint/tendermint/test/p2p/:/go/src/github.com/tendermint/tendermint/test/p2p \ | |||
--net=$NETWORK_NAME \ | |||
--ip=172.57.0.99 \ | |||
--name test_container \ | |||
--entrypoint bash \ | |||
$DOCKER_IMAGE $CMD |
@ -1,14 +1,22 @@ | |||
#! /bin/bash | |||
set -e | |||
echo `pwd` | |||
BRANCH=`git rev-parse --abbrev-ref HEAD` | |||
echo "Current branch: $BRANCH" | |||
make get_vendor_deps | |||
# go test --race github.com/tendermint/tendermint/... | |||
make test_race | |||
# run the broadcast_tx tests | |||
bash test/broadcast_tx/test.sh | |||
if [[ "$BRANCH" == "master" || "$BRANCH" == "staging" ]]; then | |||
echo "" | |||
echo "* branch $BRANCH; testing libs" | |||
# checkout every github.com/tendermint dir and run its tests | |||
bash test/test_libs.sh | |||
# TODO: mintnet/netmon | |||
fi |