2019-02-28 21:21:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-25 11:46:47 +00:00
|
|
|
# https://github.com/koalaman/shellcheck/wiki/SC2034
|
|
|
|
# shellcheck disable=2034
|
|
|
|
true
|
|
|
|
|
2019-02-28 21:21:29 +00:00
|
|
|
PWD_CMD="pwd"
|
|
|
|
# get native Windows paths on Mingw
|
|
|
|
uname | grep -qi mingw && PWD_CMD="pwd -W"
|
|
|
|
|
2019-11-25 11:46:47 +00:00
|
|
|
cd "$(dirname "$0")"
|
2019-09-01 15:02:49 +00:00
|
|
|
|
2019-02-28 21:21:29 +00:00
|
|
|
SIM_ROOT="$($PWD_CMD)"
|
|
|
|
|
2019-03-28 15:18:59 +00:00
|
|
|
# Set a default value for the env vars usually supplied by a Makefile
|
2019-11-25 11:46:47 +00:00
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
2019-03-28 15:18:59 +00:00
|
|
|
: ${GIT_ROOT:="$($PWD_CMD)"}
|
|
|
|
cd - &>/dev/null
|
2019-02-28 21:21:29 +00:00
|
|
|
|
2019-10-23 13:22:35 +00:00
|
|
|
# When changing these, also update the readme section on running simulation
|
|
|
|
# so that the run_node example is correct!
|
2019-10-08 15:34:46 +00:00
|
|
|
NUM_VALIDATORS=${VALIDATORS:-192}
|
2019-11-26 17:02:27 +00:00
|
|
|
TOTAL_NODES=${NODES:-4}
|
2019-11-11 01:28:13 +00:00
|
|
|
TOTAL_USER_NODES=${USER_NODES:-0}
|
|
|
|
TOTAL_SYSTEM_NODES=$(( TOTAL_NODES - TOTAL_USER_NODES ))
|
|
|
|
MASTER_NODE=$(( TOTAL_NODES - 1 ))
|
2019-07-01 12:36:01 +00:00
|
|
|
|
2019-03-28 15:18:59 +00:00
|
|
|
SIMULATION_DIR="${SIM_ROOT}/data"
|
2019-10-17 13:18:58 +00:00
|
|
|
METRICS_DIR="${SIM_ROOT}/prometheus"
|
2019-03-28 15:18:59 +00:00
|
|
|
VALIDATORS_DIR="${SIM_ROOT}/validators"
|
2019-10-29 16:46:41 +00:00
|
|
|
SNAPSHOT_FILE="${SIMULATION_DIR}/state_snapshot.ssz"
|
2019-10-28 23:04:52 +00:00
|
|
|
NETWORK_BOOTSTRAP_FILE="${SIMULATION_DIR}/bootstrap_nodes.txt"
|
2019-09-01 15:02:49 +00:00
|
|
|
BEACON_NODE_BIN="${SIMULATION_DIR}/beacon_node"
|
|
|
|
DEPLOY_DEPOSIT_CONTRACT_BIN="${SIMULATION_DIR}/deploy_deposit_contract"
|
2019-11-11 01:28:13 +00:00
|
|
|
MASTER_NODE_ADDRESS_FILE="${SIMULATION_DIR}/node-${MASTER_NODE}/beacon_node.address"
|
|
|
|
|
|
|
|
BASE_P2P_PORT=30000
|
2019-10-17 13:18:58 +00:00
|
|
|
BASE_METRICS_PORT=8008
|
2019-11-02 21:58:07 +00:00
|
|
|
# Set DEPOSIT_WEB3_URL_ARG to empty to get genesis state from file, not using web3
|
|
|
|
# DEPOSIT_WEB3_URL_ARG=--web3-url=ws://localhost:8545
|
|
|
|
DEPOSIT_WEB3_URL_ARG=""
|
|
|
|
DEPOSIT_CONTRACT_ADDRESS="0x"
|
2019-10-17 13:18:58 +00:00
|
|
|
|