2019-02-28 15:21:29 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-25 12:46:47 +01:00
|
|
|
# https://github.com/koalaman/shellcheck/wiki/SC2034
|
|
|
|
# shellcheck disable=2034
|
|
|
|
true
|
|
|
|
|
2019-02-28 15:21:29 -06:00
|
|
|
PWD_CMD="pwd"
|
|
|
|
# get native Windows paths on Mingw
|
|
|
|
uname | grep -qi mingw && PWD_CMD="pwd -W"
|
|
|
|
|
2019-11-25 12:46:47 +01:00
|
|
|
cd "$(dirname "$0")"
|
2019-09-01 17:02:49 +02:00
|
|
|
|
2019-02-28 15:21:29 -06:00
|
|
|
SIM_ROOT="$($PWD_CMD)"
|
|
|
|
|
2019-03-28 16:18:59 +01:00
|
|
|
# Set a default value for the env vars usually supplied by a Makefile
|
2019-11-25 12:46:47 +01:00
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
2019-03-28 16:18:59 +01:00
|
|
|
: ${GIT_ROOT:="$($PWD_CMD)"}
|
|
|
|
cd - &>/dev/null
|
2019-02-28 15:21:29 -06:00
|
|
|
|
2019-10-23 15:22:35 +02:00
|
|
|
# When changing these, also update the readme section on running simulation
|
|
|
|
# so that the run_node example is correct!
|
2019-10-09 00:34:46 +09:00
|
|
|
NUM_VALIDATORS=${VALIDATORS:-192}
|
2019-11-26 19:02:27 +02: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 15:36:01 +03:00
|
|
|
|
2020-01-23 23:16:48 +02:00
|
|
|
# You can run a mixed simulation of daemon and native libp2p nodes
|
|
|
|
# by changing the variables below:
|
2020-02-20 16:17:55 +01:00
|
|
|
NETWORK_TYPE=${NETWORK_TYPE:-"libp2p"}
|
|
|
|
BOOTSTRAP_NODE_NETWORK_TYPE=${BOOTSTRAP_NODE_NETWORK_TYPE:-"libp2p"}
|
2020-01-23 23:16:48 +02:00
|
|
|
|
2019-03-28 16:18:59 +01:00
|
|
|
SIMULATION_DIR="${SIM_ROOT}/data"
|
2019-10-17 15:18:58 +02:00
|
|
|
METRICS_DIR="${SIM_ROOT}/prometheus"
|
2019-03-28 16:18:59 +01:00
|
|
|
VALIDATORS_DIR="${SIM_ROOT}/validators"
|
2019-10-29 18:46:41 +02:00
|
|
|
SNAPSHOT_FILE="${SIMULATION_DIR}/state_snapshot.ssz"
|
2019-10-29 01:04:52 +02:00
|
|
|
NETWORK_BOOTSTRAP_FILE="${SIMULATION_DIR}/bootstrap_nodes.txt"
|
2019-09-01 17:02:49 +02:00
|
|
|
BEACON_NODE_BIN="${SIMULATION_DIR}/beacon_node"
|
2020-01-23 23:16:48 +02:00
|
|
|
BOOTSTRAP_NODE_BIN="${SIMULATION_DIR}/bootstrap_node"
|
2019-09-01 17:02:49 +02:00
|
|
|
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
|
2020-03-17 00:28:54 +02:00
|
|
|
BASE_RPC_PORT=7000
|
2019-10-17 15:18:58 +02:00
|
|
|
BASE_METRICS_PORT=8008
|
2019-11-02 22:58:07 +01: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 15:18:58 +02:00
|
|
|
|