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

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