github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/test/p2p/pex/test_dial_peers.sh (about)

     1  #! /bin/bash
     2  set -eu
     3  
     4  DOCKER_IMAGE=$1
     5  NETWORK_NAME=$2
     6  IPV=$3
     7  N=$4
     8  PROXY_APP=$5
     9  
    10  ID=1
    11  
    12  echo "----------------------------------------------------------------------"
    13  echo "Testing full network connection using one /dial_peers call"
    14  echo "(assuming peers are started with pex enabled)"
    15  
    16  # stop the existing testnet and remove local network
    17  set +e
    18  bash test/p2p/local_testnet_stop.sh $NETWORK_NAME $N
    19  set -e
    20  
    21  # start the testnet on a local network
    22  # NOTE we re-use the same network for all tests
    23  bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $IPV $N $PROXY_APP ""
    24  
    25  PERSISTENT_PEERS="\"$(test/p2p/address.sh $IPV 1 26656 $DOCKER_IMAGE)\""
    26  for i in $(seq 2 $N); do
    27  	PERSISTENT_PEERS="$PERSISTENT_PEERS,\"$(test/p2p/address.sh $IPV $i 26656 $DOCKER_IMAGE)\""
    28  done
    29  echo "$PERSISTENT_PEERS"
    30  
    31  # dial peers from one node
    32  CLIENT_NAME="dial_peers"
    33  bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $IPV $CLIENT_NAME "test/p2p/pex/dial_peers.sh $IPV $N $PERSISTENT_PEERS"
    34  
    35  # test basic connectivity and consensus
    36  # start client container and check the num peers and height for all nodes
    37  CLIENT_NAME="dial_peers_basic"
    38  bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $IPV $CLIENT_NAME "test/p2p/basic/test.sh $IPV $N"