mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-24 13:33:14 +00:00
6036f2e7d7
* Local sim impovements * Added support for running Capella and EIP-4844 simulations by downloading the correct version of Geth. * Added support for using Nimbus remote signer and Web3Signer. Use 2 out of 3 threshold signing configuration in the mainnet configuration and regular remote signing in the minimal one. * The local testnet simulation can now use a payload builder. This is currently not activated in CI due to lack of automated procedures for installing third-party relays or builders. You are adviced to use mergemock for now, but for most realistic results, we can create a simple builder based on the nimbus-eth1 codebase that will be able to propose transactions from the regular network mempool. * Start the simulation from a merged state. This would allow us to start removing pre-merge functionality such as the gossip subsciption logic. The commit also removes the merge-forcing hack installed after the TTD removal. * Consolidate all the tools used in the local simulation into a single `ncli_testnet` binary.
65 lines
1.7 KiB
Bash
Executable File
65 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPTS_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
source "${SCRIPTS_DIR}/geth_binaries.sh"
|
|
source "${SCRIPTS_DIR}/geth_vars.sh"
|
|
|
|
#These are used in the caller script
|
|
GETH_ENODES=()
|
|
|
|
log "Using ${GETH_BINARY}"
|
|
|
|
start_geth_node() {
|
|
GETH_NODE_IDX=$1
|
|
mkdir -p "${GETH_DATA_DIRS[GETH_NODE_IDX]}"
|
|
set -x
|
|
|
|
${GETH_BINARY} version
|
|
${GETH_BINARY} --datadir "${GETH_DATA_DIRS[GETH_NODE_IDX]}" init "${EXECUTION_GENESIS_JSON}"
|
|
${GETH_BINARY} \
|
|
--syncmode full \
|
|
--datadir "${GETH_DATA_DIRS[GETH_NODE_IDX]}" \
|
|
${DISCOVER} \
|
|
--http \
|
|
--http.port ${GETH_RPC_PORTS[GETH_NODE_IDX]} \
|
|
--port ${GETH_NET_PORTS[GETH_NODE_IDX]} \
|
|
--authrpc.port ${GETH_AUTH_RPC_PORTS[GETH_NODE_IDX]} \
|
|
--authrpc.jwtsecret "${JWT_FILE}"
|
|
}
|
|
|
|
for GETH_NODE_IDX in $(seq 0 $GETH_LAST_NODE_IDX); do
|
|
start_geth_node $GETH_NODE_IDX \
|
|
&> "${DATA_DIR}/geth-log${GETH_NODE_IDX}.txt" &
|
|
done
|
|
|
|
for GETH_NODE_IDX in $(seq 0 $GETH_LAST_NODE_IDX); do
|
|
GETH_RETRY=0
|
|
while :; do
|
|
if [[ -S "${GETH_DATA_DIRS[GETH_NODE_IDX]}/geth.ipc" ]]; then
|
|
echo "Geth ${GETH_NODE_IDX} started in $(( GETH_RETRY * 100 ))ms"
|
|
break
|
|
fi
|
|
if (( ++GETH_RETRY >= 300 )); then
|
|
echo "Geth ${GETH_NODE_IDX} failed to start"
|
|
exit 1
|
|
fi
|
|
sleep 0.1
|
|
done
|
|
NODE_ID=$(${GETH_BINARY} attach --datadir "${GETH_DATA_DIRS[GETH_NODE_IDX]}" --exec admin.nodeInfo.enode)
|
|
GETH_ENODES+=("${NODE_ID}")
|
|
done
|
|
|
|
#Add all nodes as peers
|
|
for dir in "${GETH_DATA_DIRS[@]}"
|
|
do
|
|
for enode in "${GETH_ENODES[@]}"
|
|
do
|
|
${GETH_BINARY} attach --datadir "${dir}" --exec "admin.addPeer(${enode})" &
|
|
done
|
|
done
|
|
|
|
log "GETH RPC Ports: ${GETH_AUTH_RPC_PORTS[*]}"
|