You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
638 B

  1. #! /bin/bash
  2. set -eu
  3. DOCKER_IMAGE=$1
  4. NETWORK_NAME=$2
  5. IPV=$3
  6. N=$4
  7. APP_PROXY=$5
  8. set +u
  9. PERSISTENT_PEERS=$6
  10. if [[ "$PERSISTENT_PEERS" != "" ]]; then
  11. echo "PersistentPeers: $PERSISTENT_PEERS"
  12. PERSISTENT_PEERS="--p2p.persistent_peers $PERSISTENT_PEERS"
  13. fi
  14. set -u
  15. # create docker network
  16. if [[ $IPV == 6 ]]; then
  17. docker network create --driver bridge --ipv6 --subnet fd80:b10c::/48 "$NETWORK_NAME"
  18. else
  19. docker network create --driver bridge --subnet 172.57.0.0/16 "$NETWORK_NAME"
  20. fi
  21. for i in $(seq 1 "$N"); do
  22. bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" $IPV "$i" "$APP_PROXY" "$PERSISTENT_PEERS --p2p.pex --rpc.unsafe"
  23. done