github.com/DFWallet/tendermint-cosmos@v0.0.2/networks/local/localnode/wrapper.sh (about)

     1  #!/usr/bin/env sh
     2  
     3  ##
     4  ## Input parameters
     5  ##
     6  BINARY=/tendermint/${BINARY:-tendermint}
     7  ID=${ID:-0}
     8  LOG=${LOG:-tendermint.log}
     9  
    10  ##
    11  ## Assert linux binary
    12  ##
    13  if ! [ -f "${BINARY}" ]; then
    14  	echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'tendermint' E.g.: -e BINARY=tendermint_my_test_version"
    15  	exit 1
    16  fi
    17  BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')"
    18  if [ -z "${BINARY_CHECK}" ]; then
    19  	echo "Binary needs to be OS linux, ARCH amd64"
    20  	exit 1
    21  fi
    22  
    23  ##
    24  ## Run binary with all parameters
    25  ##
    26  export TMHOME="/tendermint/node${ID}"
    27  
    28  if [ -d "`dirname ${TMHOME}/${LOG}`" ]; then
    29    "$BINARY" "$@" | tee "${TMHOME}/${LOG}"
    30  else
    31    "$BINARY" "$@"
    32  fi
    33  
    34  chmod 777 -R /tendermint
    35