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
This commit is contained in:
Dev Ojha
2018-06-12 02:25:52 -07:00
committed by Anton Kaliaev
parent ac80b93b60
commit b84f788f36
58 changed files with 198 additions and 198 deletions

View File

@@ -50,7 +50,7 @@ function sendTx() {
fi
set -u
if [[ "$GRPC_BROADCAST_TX" == "" ]]; then
RESPONSE=$(curl -s localhost:46657/broadcast_tx_commit?tx=0x"$TX")
RESPONSE=$(curl -s localhost:26657/broadcast_tx_commit?tx=0x"$TX")
IS_ERR=$(echo "$RESPONSE" | jq 'has("error")')
ERROR=$(echo "$RESPONSE" | jq '.error')
ERROR=$(echo "$ERROR" | tr -d '"') # remove surrounding quotes

View File

@@ -1,8 +1,8 @@
#! /bin/bash
set -e
set -ex
function toHex() {
echo -n $1 | hexdump -ve '1/1 "%.2X"' | awk '{print "0x" $0}'
echo -n $1 | hexdump -ve '1/1 "%.2X"' | awk '{print "0x" $0}'
}
@@ -15,7 +15,7 @@ TESTNAME=$1
KEY="abcd"
VALUE="dcba"
echo $(toHex $KEY=$VALUE)
curl -s 127.0.0.1:46657/broadcast_tx_commit?tx=$(toHex $KEY=$VALUE)
curl -s 127.0.0.1:26657/broadcast_tx_commit?tx=$(toHex $KEY=$VALUE)
echo $?
echo ""
@@ -56,7 +56,7 @@ set -e
echo "... testing query with /abci_query 2"
# we should be able to look up the key
RESPONSE=`curl -s "127.0.0.1:46657/abci_query?path=\"\"&data=$(toHex $KEY)&prove=false"`
RESPONSE=`curl -s "127.0.0.1:26657/abci_query?path=\"\"&data=$(toHex $KEY)&prove=false"`
RESPONSE=`echo $RESPONSE | jq .result.response.log`
set +e
@@ -69,7 +69,7 @@ fi
set -e
# we should not be able to look up the value
RESPONSE=`curl -s "127.0.0.1:46657/abci_query?path=\"\"&data=$(toHex $VALUE)&prove=false"`
RESPONSE=`curl -s "127.0.0.1:26657/abci_query?path=\"\"&data=$(toHex $VALUE)&prove=false"`
RESPONSE=`echo $RESPONSE | jq .result.response.log`
set +e
A=`echo $RESPONSE | grep 'exists'`

View File

@@ -34,5 +34,5 @@ RUN go install ./cmd/tendermint
# expose the volume for debugging
VOLUME $REPO
EXPOSE 46656
EXPOSE 46657
EXPOSE 26656
EXPOSE 26657

View File

@@ -21,10 +21,10 @@ 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 46656, our list of seed nodes will look like:
Since we use Tendermint's default listening port of 26656, our list of seed nodes will look like:
```
172.57.0.101:46656,172.57.0.102:46656,172.57.0.103:46656,172.57.0.104:46656
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/`.
@@ -38,7 +38,7 @@ for i in $(seq 1 4); do
--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:46656,172.57.0.102:46656,172.57.0.103:46656,172.57.0.104:46656 --proxy_app=kvstore
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
```
@@ -47,7 +47,7 @@ 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:46657/status | jq .
curl 172.57.0.101:26657/status | jq .
```

View File

@@ -14,7 +14,7 @@ N=$1
echo ""
# run the test on each of them
for i in $(seq 1 "$N"); do
addr=$(test/p2p/ip.sh "$i"):46657
addr=$(test/p2p/ip.sh "$i"):26657
# current state
HASH1=$(curl -s "$addr/status" | jq .result.sync_info.latest_app_hash)
@@ -37,7 +37,7 @@ for i in $(seq 1 "$N"); do
minHeight=$h2
for j in $(seq 1 "$N"); do
if [[ "$i" != "$j" ]]; then
addrJ=$(test/p2p/ip.sh "$j"):46657
addrJ=$(test/p2p/ip.sh "$j"):26657
h=$(curl -s "$addrJ/status" | jq .result.sync_info.latest_block_height)
while [ "$h" -lt "$minHeight" ]; do
@@ -57,7 +57,7 @@ for i in $(seq 1 "$N"); do
# check we get the same new hash on all other nodes
for j in $(seq 1 "$N"); do
if [[ "$i" != "$j" ]]; then
addrJ=$(test/p2p/ip.sh "$j"):46657
addrJ=$(test/p2p/ip.sh "$j"):26657
HASH3=$(curl -s "$addrJ/status" | jq .result.sync_info.latest_app_hash)
if [[ "$HASH2" != "$HASH3" ]]; then

View File

@@ -16,7 +16,7 @@ MAX_SLEEP=60
# wait for everyone to come online
echo "Waiting for nodes to come online"
for i in `seq 1 $N`; do
addr=$(test/p2p/ip.sh $i):46657
addr=$(test/p2p/ip.sh $i):26657
curl -s $addr/status > /dev/null
ERR=$?
COUNT=0
@@ -36,7 +36,7 @@ done
echo ""
# wait for each of them to sync up
for i in `seq 1 $N`; do
addr=$(test/p2p/ip.sh $i):46657
addr=$(test/p2p/ip.sh $i):26657
N_1=$(($N - 1))
# - assert everyone has N-1 other peers

View File

@@ -10,9 +10,9 @@ ID=$1
#
###########################################
addr=$(test/p2p/ip.sh $ID):46657
addr=$(test/p2p/ip.sh $ID):26657
peerID=$(( $(($ID % 4)) + 1 )) # 1->2 ... 3->4 ... 4->1
peer_addr=$(test/p2p/ip.sh $peerID):46657
peer_addr=$(test/p2p/ip.sh $peerID):26657
# get another peer's height
h1=`curl -s $peer_addr/status | jq .result.sync_info.latest_block_height`

View File

@@ -23,9 +23,9 @@ set +e # circle sigh :(
set -e
# restart peer - should have an empty blockchain
PERSISTENT_PEERS="$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):46656"
PERSISTENT_PEERS="$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):26656"
for j in `seq 2 $N`; do
PERSISTENT_PEERS="$PERSISTENT_PEERS,$(test/p2p/ip_plus_id.sh $j $DOCKER_IMAGE):46656"
PERSISTENT_PEERS="$PERSISTENT_PEERS,$(test/p2p/ip_plus_id.sh $j $DOCKER_IMAGE):26656"
done
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $PROXY_APP "--p2p.persistent_peers $PERSISTENT_PEERS --p2p.pex --rpc.unsafe"

View File

@@ -9,7 +9,7 @@ MAX_ATTEMPTS_TO_CATCH_UP=120
echo "Waiting for nodes to come online"
set +e
for i in $(seq 1 "$NUM_OF_PEERS"); do
addr=$(test/p2p/ip.sh "$i"):46657
addr=$(test/p2p/ip.sh "$i"):26657
curl -s "$addr/status" > /dev/null
ERR=$?
while [ "$ERR" != 0 ]; do
@@ -22,7 +22,7 @@ done
set -e
# get the first peer's height
addr=$(test/p2p/ip.sh 1):46657
addr=$(test/p2p/ip.sh 1):26657
h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height)
echo "1st peer is on height $h1"
@@ -32,7 +32,7 @@ for i in $(seq 2 "$NUM_OF_PEERS"); do
hi=0
while [[ $hi -le $h1 ]] ; do
addr=$(test/p2p/ip.sh "$i"):46657
addr=$(test/p2p/ip.sh "$i"):26657
hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height)
echo "... peer $i is on height $hi"

View File

@@ -6,8 +6,8 @@ DOCKER_IMAGE=$2
cd "$GOPATH/src/github.com/tendermint/tendermint"
persistent_peers="$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):46656"
persistent_peers="$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):26656"
for i in $(seq 2 $N); do
persistent_peers="$persistent_peers,$(test/p2p/ip_plus_id.sh $i $DOCKER_IMAGE):46656"
persistent_peers="$persistent_peers,$(test/p2p/ip_plus_id.sh $i $DOCKER_IMAGE):26656"
done
echo "$persistent_peers"

View File

@@ -4,7 +4,7 @@ set -u
ID=$1
N=$2
addr=$(test/p2p/ip.sh "$ID"):46657
addr=$(test/p2p/ip.sh "$ID"):26657
echo "2. wait until peer $ID connects to other nodes using pex reactor"
peers_count="0"

View File

@@ -8,7 +8,7 @@ cd "$GOPATH/src/github.com/tendermint/tendermint"
echo "Waiting for nodes to come online"
for i in $(seq 1 "$N"); do
addr=$(test/p2p/ip.sh "$i"):46657
addr=$(test/p2p/ip.sh "$i"):26657
curl -s "$addr/status" > /dev/null
ERR=$?
while [ "$ERR" != 0 ]; do
@@ -20,4 +20,4 @@ for i in $(seq 1 "$N"); do
done
IP=$(test/p2p/ip.sh 1)
curl "$IP:46657/dial_peers?persistent=true&peers=\\[$PEERS\\]"
curl "$IP:26657/dial_peers?persistent=true&peers=\\[$PEERS\\]"

View File

@@ -23,9 +23,9 @@ set -e
# NOTE we re-use the same network for all tests
bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP ""
PERSISTENT_PEERS="\"$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):46656\""
PERSISTENT_PEERS="\"$(test/p2p/ip_plus_id.sh 1 $DOCKER_IMAGE):26656\""
for i in $(seq 2 $N); do
PERSISTENT_PEERS="$PERSISTENT_PEERS,\"$(test/p2p/ip_plus_id.sh $i $DOCKER_IMAGE):46656\""
PERSISTENT_PEERS="$PERSISTENT_PEERS,\"$(test/p2p/ip_plus_id.sh $i $DOCKER_IMAGE):26656\""
done
echo "$PERSISTENT_PEERS"

View File

@@ -82,7 +82,7 @@ for failIndex in $(seq $failsStart $failsEnd); do
echo "* Test FailIndex $failIndex"
# test failure at failIndex
bash $(dirname $0)/txs.sh "localhost:46657" &
bash $(dirname $0)/txs.sh "localhost:26657" &
start_procs 1 "$failIndex"
# tendermint should already have exited when it hits the fail index

View File

@@ -27,7 +27,7 @@ function send_txs(){
for i in `seq 1 5`; do
for j in `seq 1 100`; do
tx=`head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"'`
curl -s 127.0.0.1:46657/broadcast_tx_async?tx=0x$tx &> /dev/null
curl -s 127.0.0.1:26657/broadcast_tx_async?tx=0x$tx &> /dev/null
done
sleep 1
done
@@ -41,7 +41,7 @@ kill_procs
start_procs 2
# wait for node to handshake and make a new block
addr="localhost:46657"
addr="localhost:26657"
curl -s $addr/status > /dev/null
ERR=$?
i=0

View File

@@ -2,7 +2,7 @@
set -u
# wait till node is up, send txs
ADDR=$1 #="127.0.0.1:46657"
ADDR=$1 #="127.0.0.1:26657"
curl -s $ADDR/status > /dev/null
ERR=$?
while [ "$ERR" != 0 ]; do