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

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