github.com/FusionFoundation/efsn/v4@v4.2.0/docker-entrypoint-gtw.sh (about)

     1  #!/bin/sh
     2  NODES_ROOT=/fusion-node
     3  # NODES_ROOT=/Users/work/dev/tmp/fusion-node
     4  DATA_DIR=$NODES_ROOT/data
     5  ethstats=
     6  testnet=
     7  
     8  display_usage() {
     9      echo "Commands for Fusion efsn:"
    10      echo -e "-e value    Reporting name of a ethstats service"
    11      echo -e "-tn         Connect to testnet"
    12      }
    13  
    14  while [ "$1" != "" ]; do
    15      case $1 in
    16          -e | --ethstats )       shift
    17                                  ethstats=$1
    18                                  ;;
    19          -tn | --testnet )       testnet=true
    20                                  ;;
    21          * )                     display_usage
    22                                  exit 1
    23      esac
    24      shift
    25  done
    26  
    27  # create data folder if does not exit
    28  if [ ! -d "$DATA_DIR" ]; then
    29      mkdir $DATA_DIR
    30  fi
    31  
    32  # format command option
    33  cmd_options="--datadir $DATA_DIR"
    34  
    35  # Following the geth documentation at https://geth.ethereum.org/docs/rpc/server
    36  # cmd_options_local_gtw=' --identity 1 --rpc --rpcapi "eth,net,fsn,fsntx" --rpcaddr 127.0.0.1 --rpcport 9000 --rpccorsdomain "*" --ws  --wsapi "eth,net,fsn,fsntx" --wsaddr 127.0.0.1 --wsport 9001 --wsorigins "*"'
    37  cmd_options_local_gtw=' --identity 1 --http --http.api=eth,net,fsn,fsntx --http.addr=0.0.0.0 --http.port=9000 --http.corsdomain=* --ws --ws.api=eth,net,fsn,fsntx --ws.addr=0.0.0.0 --ws.port=9001 --ws.origins=*'
    38  
    39  if [ "$testnet" ]; then
    40      testnet=" --testnet"
    41      cmd_options=$cmd_options$testnet
    42  fi     
    43  
    44  if [ "$ethstats" ]; then
    45      if [ "$testnet" ]; then
    46          ethstats=" --ethstats $ethstats:devFusioInfo2019142@devnodestats.fusionnetwork.io"
    47      else 
    48          ethstats=" --ethstats $ethstats:fsnMainnet@node.fusionnetwork.io"
    49      fi
    50      cmd_options=$cmd_options$ethstats
    51  fi
    52  
    53  echo "flags: $cmd_options$cmd_options_local_gtw"
    54  
    55  # efsn  --unlock $unlock --ethstats
    56  exec efsn $cmd_options$cmd_options_local_gtw