Allow overriding the bootstrap node in run_node.sh

This commit is contained in:
Zahary Karadjov 2019-11-25 21:56:28 +02:00 committed by zah
parent 8de4d38e4e
commit 1d8bfd8c0d
2 changed files with 11 additions and 2 deletions

View File

@ -272,7 +272,7 @@ else:
proc saveConnectionAddressFile*(node: Eth2Node, filename: string) =
let id = waitFor node.daemon.identity()
Json.saveFile(filename, id, pretty = false)
writeFile(filename, $id.addresses[0] & "/p2p/" & id.peer.pretty)
proc loadConnectionAddressFile*(filename: string): PeerInfo =
Json.loadFile(filename, PeerInfo)

View File

@ -9,6 +9,15 @@ shift
# shellcheck source=/dev/null
source "$(dirname "$0")/vars.sh"
if [[ ! -z "$1" ]]; then
BOOTSTRAP_NODE_ID=$1
BOOTSTRAP_ADDRESS_FILE="${SIMULATION_DIR}/node-${BOOTSTRAP_NODE_ID}/beacon_node.address"
shift
else
BOOTSTRAP_NODE_ID=$MASTER_NODE
BOOTSTRAP_ADDRESS_FILE=$NETWORK_BOOTSTRAP_FILE
fi
# set up the environment
# shellcheck source=/dev/null
source "${SIM_ROOT}/../../env.sh"
@ -36,7 +45,7 @@ if [[ $NODE_ID -lt $TOTAL_NODES ]]; then
fi
$BEACON_NODE_BIN \
--bootstrap-file=$NETWORK_BOOTSTRAP_FILE \
--bootstrap-file=$BOOTSTRAP_ADDRESS_FILE \
--data-dir=$DATA_DIR \
--node-name=$NODE_ID \
--tcp-port=$PORT \