Skip to content

Commit

Permalink
support multiple consensus nodes in nimbus-vc (#1988)
Browse files Browse the repository at this point in the history
* pass CL_NODE into script, parse in script

* fix spelling

* linting fixes

* lint fix 2

* remove env Nimbus comment

* variable naming
  • Loading branch information
b0a7 authored Nov 18, 2024
1 parent 5f8f62e commit 743db20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ JWT_SECRET=
DISTRIBUTED=
# Authenticated execution client endpoint. This default uses the execution node container.
EL_NODE=http://execution:8551
# Consensus client address. This could be comma-separated for Lighthouse or Teku VC clients, with failover,
# Consensus client address. This could be comma-separated for Lighthouse, Nimbus or Teku VC clients, with failover,
# or could just be a remote consensus client URL for "validator only" setups.
# For Nimbus VC client, put the first beacon node here, and use VC_EXTRAS for additional.
CL_NODE=http://consensus:5052
# MEV-boost address. This would only be changed for Vouch setups
MEV_NODE=http://mev-boost:18550
Expand Down
2 changes: 1 addition & 1 deletion nimbus-vc-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
- jwtsecret:/var/lib/nimbus/ee-secret
environment:
- MEV_BOOST=${MEV_BOOST}
- CL_NODE=${CL_NODE}
- DOPPELGANGER=${DOPPELGANGER}
- LOG_LEVEL=${LOG_LEVEL}
- VC_EXTRAS=${VC_EXTRAS:-}
Expand All @@ -49,7 +50,6 @@ services:
- /usr/local/bin/nimbus_validator_client
- --data-dir=/var/lib/nimbus
- --non-interactive
- --beacon-node=${CL_NODE}
- --metrics
- --metrics-port=8009
- --metrics-address=0.0.0.0
Expand Down
11 changes: 9 additions & 2 deletions nimbus/docker-entrypoint-vc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ else
__mev_boost=""
fi

# accomodate comma separated list of consensus nodes
__nodes=$(echo "$CL_NODE" | tr ',' ' ')
__beacon_nodes=()
for __node in $__nodes; do
__beacon_nodes+=("--beacon-node=$__node")
done

__log_level="--log-level=${LOG_LEVEL^^}"

# Web3signer URL
Expand Down Expand Up @@ -60,9 +67,9 @@ fi
if [ "${DEFAULT_GRAFFITI}" = "true" ]; then
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${__w3s_url} ${__log_level} ${__doppel} ${__mev_boost} ${__att_aggr} ${VC_EXTRAS}
exec "$@" "${__beacon_nodes[@]}" ${__w3s_url} ${__log_level} ${__doppel} ${__mev_boost} ${__att_aggr} ${VC_EXTRAS}
else
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${__w3s_url} "--graffiti=${GRAFFITI}" ${__log_level} ${__doppel} ${__mev_boost} ${__att_aggr} ${VC_EXTRAS}
exec "$@" "${__beacon_nodes[@]}" ${__w3s_url} "--graffiti=${GRAFFITI}" ${__log_level} ${__doppel} ${__mev_boost} ${__att_aggr} ${VC_EXTRAS}
fi

0 comments on commit 743db20

Please sign in to comment.