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.

46 lines
1.4 KiB

  1. #! /bin/bash
  2. set -eu
  3. DOCKER_IMAGE=$1
  4. NETWORK_NAME=$2
  5. ID=$3
  6. APP_PROXY=$4
  7. set +u
  8. NODE_FLAGS=$5
  9. set -u
  10. echo "starting tendermint peer ID=$ID"
  11. # start tendermint container on the network
  12. # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be
  13. # treated as one flag.
  14. # test/p2p/data/mach$((ID-1)) data is generated in test/docker/Dockerfile using
  15. # the tendermint testnet command.
  16. if [[ "$ID" == "x" ]]; then # Set "x" to "1" to print to console.
  17. docker run \
  18. --net="$NETWORK_NAME" \
  19. --ip=$(test/p2p/ip.sh "$ID") \
  20. --name "local_testnet_$ID" \
  21. --entrypoint tendermint \
  22. -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$((ID-1))" \
  23. -e GOMAXPROCS=1 \
  24. --log-driver=syslog \
  25. --log-opt syslog-address=udp://127.0.0.1:5514 \
  26. --log-opt syslog-facility=daemon \
  27. --log-opt tag="{{.Name}}" \
  28. "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" &
  29. else
  30. docker run -d \
  31. --net="$NETWORK_NAME" \
  32. --ip=$(test/p2p/ip.sh "$ID") \
  33. --name "local_testnet_$ID" \
  34. --entrypoint tendermint \
  35. -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$((ID-1))" \
  36. -e GOMAXPROCS=1 \
  37. --log-driver=syslog \
  38. --log-opt syslog-address=udp://127.0.0.1:5514 \
  39. --log-opt syslog-facility=daemon \
  40. --log-opt tag="{{.Name}}" \
  41. "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY"
  42. fi