github.com/evdatsion/aphelion-dpos-bft@v0.32.1/test/p2p/test.sh (about)

     1  #! /bin/bash
     2  set -eu
     3  
     4  DOCKER_IMAGE=$1
     5  NETWORK_NAME=local_testnet
     6  N=4
     7  PROXY_APP=persistent_kvstore
     8  
     9  cd "$GOPATH/src/github.com/evdatsion/aphelion-dpos-bft"
    10  
    11  # stop the existing testnet and remove local network
    12  set +e
    13  bash test/p2p/local_testnet_stop.sh "$NETWORK_NAME" "$N"
    14  set -e
    15  
    16  PERSISTENT_PEERS=$(bash test/p2p/persistent_peers.sh $N $DOCKER_IMAGE)
    17  
    18  # start the testnet on a local network
    19  # NOTE we re-use the same network for all tests
    20  bash test/p2p/local_testnet_start.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP" "$PERSISTENT_PEERS"
    21  
    22  # test basic connectivity and consensus
    23  # start client container and check the num peers and height for all nodes
    24  bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" basic "test/p2p/basic/test.sh $N"
    25  
    26  # test atomic broadcast:
    27  # start client container and test sending a tx to each node
    28  bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" ab "test/p2p/atomic_broadcast/test.sh $N"
    29  
    30  # test fast sync (from current state of network):
    31  # for each node, kill it and readd via fast sync
    32  bash test/p2p/fast_sync/test.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP"
    33  
    34  # test killing all peers 3 times
    35  bash test/p2p/kill_all/test.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" 3
    36  
    37  # test pex
    38  bash test/p2p/pex/test.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP"