tendermint/test/p2p
Dev Ojha b84f788f36 Switch ports 466xx to 266xx (#1735)
* Switch ports 466xx to be 266xx
This is done so the default ports aren't in the linux kernel's default ephemeral port range.

* Update ABCI import

* Bump cache on circleci

* Get more verbose output for debugging

* Bump abci dependency

* Fix accidental change of a block header's hash

* pin abci release
2018-06-12 13:25:52 +04:00
..
atomic_broadcast Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
basic Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
data fix addresses 2018-04-07 23:13:41 +03:00
fast_sync Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
kill_all Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
pex Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
README.md Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
circleci.sh move a file to remove a directory 2018-05-18 13:37:58 -04:00
client.sh test/p2p: shellcheck 2017-03-06 03:49:48 -05:00
ip.sh p2p: introduce peerConn to simplify peer creation (#1226) 2018-02-27 15:54:40 +04:00
ip_plus_id.sh p2p: introduce peerConn to simplify peer creation (#1226) 2018-02-27 15:54:40 +04:00
local_testnet_start.sh rename manual peers to persistent peers 2018-01-09 16:18:05 -06:00
local_testnet_stop.sh test/p2p: shellcheck 2017-03-06 03:49:48 -05:00
peer.sh fix addresses 2018-04-07 23:13:41 +03:00
persistent_peers.sh Switch ports 466xx to 266xx (#1735) 2018-06-12 13:25:52 +04:00
test.sh rename dummy to kvstore (#1223) 2018-02-27 18:01:10 +04:00

README.md

Tendermint P2P Tests

These scripts facilitate setting up and testing a local testnet using docker containers.

Setup your own local testnet as follows.

For consistency, we assume all commands are run from the Tendermint repository root (ie. $GOPATH/src/github.com/tendermint/tendermint).

First, build the docker image:

docker build -t tendermint_tester -f ./test/docker/Dockerfile .

Now create the docker network:

docker network create --driver bridge --subnet 172.57.0.0/16 my_testnet

This gives us a new network with IP addresses in the rage 172.57.0.0 - 172.57.255.255. Peers on the network can have any IP address in this range. For our four node network, let's pick 172.57.0.101 - 172.57.0.104. Since we use Tendermint's default listening port of 26656, our list of seed nodes will look like:

172.57.0.101:26656,172.57.0.102:26656,172.57.0.103:26656,172.57.0.104:26656

Now we can start up the peers. We already have config files setup in test/p2p/data/. Let's use a for-loop to start our peers:

for i in $(seq 1 4); do
	docker run -d \
	  --net=my_testnet\
	  --ip="172.57.0.$((100 + $i))" \
	  --name local_testnet_$i \
	  --entrypoint tendermint \
	  -e TMHOME=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$i/core \
	  tendermint_tester node --p2p.persistent_peers 172.57.0.101:26656,172.57.0.102:26656,172.57.0.103:26656,172.57.0.104:26656 --proxy_app=kvstore
done

If you now run docker ps, you'll see your containers!

We can confirm they are making blocks by checking the /status message using curl and jq to pretty print the output json:

curl 172.57.0.101:26657/status | jq .