Skip to content

Commit

Permalink
New Nimbus Teku use a dedicated VC (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne authored Dec 1, 2023
1 parent 70b676f commit d23f416
Show file tree
Hide file tree
Showing 8 changed files with 432 additions and 85 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Eth Docker uses a "semver-ish" scheme.
large.
- Second through fourth digit, [semver](https://semver.org/).

This is Eth Docker v2.3.10.0
This is Eth Docker v2.3.11.0
2 changes: 1 addition & 1 deletion default.env
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,4 @@ DDNS_TAG=3
NODE_EXPORTER_IGNORE_MOUNT_REGEX='^/(dev|proc|sys|run|var/lib/docker/.+)($|/)'

# Used by ethd update - please do not adjust
ENV_VERSION=3
ENV_VERSION=4
34 changes: 21 additions & 13 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -493,17 +493,17 @@ migrate_compose_file() {
lh-validator.yml lodestar-consensus.yml lodestar-validator.yml nimbus-consensus.yml prysm-consensus.yml \
prysm-consensus-rest.yml prysm-validator.yml teku-consensus.yml teku-validator.yml lh-base.yml lh-vc-only.yml \
lh-cl-only.yml nm.yml lighthouse-base.yml teku-base.yml nimbus-base.yml prysm-base.yml lodestar-base.yml \
traefik-cf-v6.yml validator-keyapi-localport.yml consensus-keyapi-localport.yml v6-network.yml prysm-web.yml \
blank-grafana.yml lh-grafana.yml lhcc-grafana.yml nimbus-grafana.yml prysm-grafana.yml teku-grafana.yml \
geth-grafana.yml erigon-grafana.yml oe.yml teku-stats.yml lh-stats.yml lh-stats-consensus.yml \
traefik-cf-v6.yml validator-keyapi-localport.yml consensus-keyapi-localport.yml v6-network.yml nimbus.yml teku.yml \
prysm-web.yml blank-grafana.yml lh-grafana.yml lhcc-grafana.yml nimbus-grafana.yml prysm-grafana.yml \
teku-grafana.yml geth-grafana.yml erigon-grafana.yml oe.yml teku-stats.yml lh-stats.yml lh-stats-consensus.yml \
lh-stats-validator.yml traefik-shared.yml lighthouse-slasher.yml prysm-slasher.yml grafana-localhost.yml )
TO_YML=( el-shared.yml el-traefik.yml cl-shared.yml grafana-shared.yml prysm-web-shared.yml lighthouse-base.yml \
lighthouse-vc-only.yml lighthouse-slasher.yml teku-base.yml teku-vc-only.yml lighthouse-cl-only.yml \
lighthouse-vc-only.yml lodestar-cl-only.yml lodestar-vc-only.yml nimbus-cl-only.yml prysm-cl-only.yml \
prysm-cl-only.yml prysm-vc-only.yml teku-cl-only.yml teku-vc-only.yml lighthouse-base.yml \
lighthouse-vc-only.yml lighthouse-cl-only.yml nethermind.yml lighthouse.yml teku.yml nimbus.yml prysm.yml \
lodestar.yml traefik-cf.yml validator-keyapi-shared.yml consensus-keyapi-shared.yml ipv6.yml \
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" )
lodestar.yml traefik-cf.yml validator-keyapi-shared.yml consensus-keyapi-shared.yml ipv6.yml nimbus-legacy.yml \
teku-legacy.yml "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" )

__old_grafana=0
__new_grafana=0
Expand All @@ -529,8 +529,14 @@ migrate_compose_file() {
fi
for index in "${!FROM_YML[@]}"; do
if [ "${FROM_YML[index]}" = "${__ymlfile}" ]; then
__ymlfile=${TO_YML[index]}
break
# ENV version 3 and earlier use the legacy files
if [[ "${__ymlfile}" = "nimbus.yml" ]] || [[ "${__ymlfile}" = "teku.yml" ]] \
&& [[ -n "${__source_ver}" ]] && [[ "${__source_ver}" -gt 3 ]]; then
break
else
__ymlfile=${TO_YML[index]}
break
fi
fi
done
if [ -n "${__ymlfile}" ]; then
Expand Down Expand Up @@ -897,7 +903,8 @@ valid address is set" 12 75
# I do mean to match literally
# shellcheck disable=SC2076
if [[ "${value}" =~ "prysm.yml" || "${value}" =~ "lighthouse.yml" || "${value}" =~ "teku.yml" \
|| "${value}" =~ "nimbus.yml" || "${value}" =~ "lodestar.yml" || "${value}" =~ "-cl-only.yml" ]]; then
|| "${value}" =~ "nimbus.yml" || "${value}" =~ "lodestar.yml" || "${value}" =~ "-cl-only.yml" \
|| "${value}" =~ "-legacy.yml" ]]; then
if [[ ! "${value}" =~ "geth.yml" && ! "${value}" =~ "besu.yml" && ! "${value}" =~ "erigon.yml" \
&& ! "${value}" =~ "nethermind.yml" && ! "${value}" =~ "nimbus-el.yml" \
&& ! "${value}" =~ "reth.yml" ]]; then
Expand All @@ -909,7 +916,8 @@ ${ENV_FILE}" 12 75
elif [[ "${value}" =~ "geth.yml" || "${value}" =~ "besu.yml" || "${value}" =~ "erigon.yml" \
|| "${value}" =~ "nethermind.yml" || "${value}" =~ "nimbus-el.yml" || "${value}" =~ "reth.yml" ]]; then
if [[ ! "${value}" =~ "prysm.yml" && ! "${value}" =~ "lighthouse.yml" && ! "${value}" =~ "teku.yml" \
&& ! "${value}" =~ "nimbus.yml" && ! "${value}" =~ "lodestar.yml" && ! "${value}" =~ "-cl-only.yml" ]]; then
&& ! "${value}" =~ "nimbus.yml" && ! "${value}" =~ "lodestar.yml" && ! "${value}" =~ "-cl-only.yml" \
&& ! "${value}" =~ "-legacy.yml" ]]; then
whiptail --msgbox "A Consensus Layer client is required alongside your Execution Layer client since \
Ethereum Merge.\n\nIf you run a distributed setup, you can shut off this nag screen by setting DISTRIBUTED=true in \
${ENV_FILE}" 12 75
Expand Down Expand Up @@ -1231,10 +1239,10 @@ resync-consensus() {
case "${value}" in
*lighthouse.yml* ) __cl_volume='lhbeacon-data'; __cl_client="lighthouse";;
*lighthouse-cl-only.yml* ) __cl_volume='lhconsensus-data'; __cl_client="lighthouse";;
*teku.yml* ) __cl_volume='wipe-db'; __cl_client="teku";;
*teku-cl-only.yml* ) __cl_volume='tekuconsensus-data'; __cl_client="teku";;
*nimbus.yml* ) __cl_volume='wipe-db'; __cl_client="nimbus";;
*nimbus-cl-only.yml* ) __cl_volume='nimbus-consensus-data'; __cl_client="nimbus";;
*teku-legacy.yml* ) __cl_volume='wipe-db'; __cl_client="teku";;
*teku.yml* | *teku-cl-only.yml* ) __cl_volume='tekuconsensus-data'; __cl_client="teku";;
*nimbus-legacy.yml* ) __cl_volume='wipe-db'; __cl_client="nimbus";;
*nimbus.yml* | *nimbus-cl-only.yml* ) __cl_volume='nimbus-consensus-data'; __cl_client="nimbus";;
*lodestar.yml* | *lodestar-cl-only.yml* ) __cl_volume='lsconsensus-data'; __cl_client="lodestar";;
*prysm.yml* ) __cl_volume='prysmbeacon-data'; __cl_client="prysm";;
*prysm-cl-only.yml* ) __cl_volume='prysmconsensus-data'; __cl_client="prysm";;
Expand Down
146 changes: 146 additions & 0 deletions nimbus-legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
version: "3.9"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &nimbus-build
context: ./nimbus
dockerfile: ${NIM_DOCKERFILE}
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'}
- SRC_REPO=${NIM_SRC_REPO:-https://github.com/status-im/nimbus-eth2}
- DOCKER_TAG=${NIM_DOCKER_TAG:-multiarch-latest}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG:-multiarch-latest}
- DOCKER_REPO=${NIM_DOCKER_REPO:-statusim/nimbus-eth2}
- DOCKER_VC_REPO=${NIM_DOCKER_VC_REPO:-statusim/nimbus-validator-client}

services:
consensus:
restart: "unless-stopped"
build:
target: consensus
<<: *nimbus-build
image: nimbus:local
user: user
stop_grace_period: 1m
volumes:
- nimbus-data:/var/lib/nimbus
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nimbus/ee-secret
environment:
- RAPID_SYNC_URL=${RAPID_SYNC_URL}
- NETWORK=${NETWORK}
- JWT_SECRET=${JWT_SECRET}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- DOPPELGANGER=${DOPPELGANGER}
- LOG_LEVEL=${LOG_LEVEL}
- CL_EXTRAS=${CL_EXTRAS:-}
- VC_EXTRAS=${VC_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false}
- WEB3SIGNER=${WEB3SIGNER:-false}
- EMBEDDED_VC=true
ports:
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
- eth2
<<: *logging
entrypoint:
- docker-entrypoint.sh
- /usr/local/bin/nimbus_beacon_node
- --data-dir=/var/lib/nimbus
- --non-interactive
- --status-bar=false
- --tcp-port=${CL_P2P_PORT:-9000}
- --udp-port=${CL_P2P_PORT:-9000}
- --max-peers=${CL_MAX_PEER_COUNT:-160}
- --el=${EL_NODE}
- --jwt-secret=/var/lib/nimbus/ee-secret/jwtsecret
- --rest
- --rest-address=0.0.0.0
- --rest-port=${CL_REST_PORT:-5052}
- --enr-auto-update=true
- --metrics
- --metrics-port=8008
- --metrics-address=0.0.0.0
- --keymanager
- --keymanager-port=${KEY_API_PORT:-7500}
- --keymanager-address=0.0.0.0
- --keymanager-allow-origin=*
- --keymanager-token-file=/var/lib/nimbus/api-token.txt
- --suggested-fee-recipient=${FEE_RECIPIENT}
labels:
- metrics.scrape=true
- metrics.path=/metrics
- metrics.port=8008

wipe-db:
profiles: ["tools"]
restart: "no"
image: alpine:3
user: "10002"
volumes:
- nimbus-data:/var/lib/nimbus
- /etc/localtime:/etc/localtime:ro
entrypoint: ["/bin/sh","-c"]
command:
- |
rm -rf /var/lib/nimbus/db/*
rm /var/lib/nimbus/setupdone
validator-exit:
profiles: ["tools"]
restart: "no"
build:
target: consensus
<<: *nimbus-build
image: nimbus:local
user: root
volumes:
- /etc/localtime:/etc/localtime:ro
- ./.eth/validator_keys:/validator_keys
entrypoint:
- validator-exit.sh
- /usr/local/bin/nimbus_beacon_node
- --log-level=${LOG_LEVEL}
- deposits
- exit
- --rest-url=http://consensus:5052
- --validator=

validator-keys:
profiles: ["tools"]
restart: "no"
build:
context: ./vc-utils
image: vc-utils:local
user: root
volumes:
- nimbus-data:/var/lib/nimbus
- ./.eth/validator_keys:/validator_keys
- ./.eth/exit_messages:/exit_messages
- /etc/localtime:/etc/localtime:ro
environment:
- KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-}
- KEY_API_PORT=${KEY_API_PORT:-7500}
- WEB3SIGNER=${WEB3SIGNER:-false}
- CL_NODE=${CL_NODE}
depends_on:
- consensus
entrypoint:
- keymanager.sh
- /var/lib/nimbus/api-token.txt
- consensus

volumes:
nimbus-data:
jwtsecret:
96 changes: 56 additions & 40 deletions nimbus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
user: user
stop_grace_period: 1m
volumes:
- nimbus-data:/var/lib/nimbus
- nimbus-consensus-data:/var/lib/nimbus
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nimbus/ee-secret
environment:
Expand All @@ -37,15 +37,15 @@ services:
- JWT_SECRET=${JWT_SECRET}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- DOPPELGANGER=${DOPPELGANGER}
- LOG_LEVEL=${LOG_LEVEL}
- DOPPELGANGER=false
- CL_EXTRAS=${CL_EXTRAS:-}
- VC_EXTRAS=${VC_EXTRAS:-}
- VC_EXTRAS=
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false}
- WEB3SIGNER=${WEB3SIGNER:-false}
- EMBEDDED_VC=true
- DEFAULT_GRAFFITI=true
- WEB3SIGNER=false
- EMBEDDED_VC=false
ports:
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
Expand All @@ -72,6 +72,46 @@ services:
- --metrics
- --metrics-port=8008
- --metrics-address=0.0.0.0
- --suggested-fee-recipient=${FEE_RECIPIENT}
- --in-process-validators=false
labels:
- metrics.scrape=true
- metrics.path=/metrics
- metrics.port=8008

validator:
restart: "unless-stopped"
build:
target: validator
<<: *nimbus-build
image: nimbus-validator:local
user: user
volumes:
- nimbus-vc-data:/var/lib/nimbus
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nimbus/ee-secret
environment:
- MEV_BOOST=${MEV_BOOST}
- DOPPELGANGER=${DOPPELGANGER}
- LOG_LEVEL=${LOG_LEVEL}
- VC_EXTRAS=${VC_EXTRAS:-}
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false}
- WEB3SIGNER=${WEB3SIGNER:-false}
networks:
default:
aliases:
- vc
<<: *logging
entrypoint:
- docker-entrypoint-vc.sh
- /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
- --keymanager
- --keymanager-port=${KEY_API_PORT:-7500}
- --keymanager-address=0.0.0.0
Expand All @@ -81,41 +121,16 @@ services:
labels:
- metrics.scrape=true
- metrics.path=/metrics
- metrics.port=8008

wipe-db:
profiles: ["tools"]
restart: "no"
image: alpine:3
user: "10002"
volumes:
- nimbus-data:/var/lib/nimbus
- /etc/localtime:/etc/localtime:ro
entrypoint: ["/bin/sh","-c"]
command:
- |
rm -rf /var/lib/nimbus/db/*
rm /var/lib/nimbus/setupdone
- metrics.port=8009

validator-exit:
profiles: ["tools"]
restart: "no"
build:
target: consensus
<<: *nimbus-build
image: nimbus:local
user: root
volumes:
- /etc/localtime:/etc/localtime:ro
- ./.eth/validator_keys:/validator_keys
image: alpine:3
entrypoint:
- validator-exit.sh
- /usr/local/bin/nimbus_beacon_node
- --log-level=${LOG_LEVEL}
- deposits
- exit
- --rest-url=http://consensus:5052
- --validator=
- /bin/sh
- -c
- echo "Legacy exit not supported with Nimbus validator client. Please use ./ethd keys sign-exit instead, then submit to beaconcha.in or use ./ethd keys send-exit"

validator-keys:
profiles: ["tools"]
Expand All @@ -125,7 +140,7 @@ services:
image: vc-utils:local
user: root
volumes:
- nimbus-data:/var/lib/nimbus
- nimbus-vc-data:/var/lib/nimbus
- ./.eth/validator_keys:/validator_keys
- ./.eth/exit_messages:/exit_messages
- /etc/localtime:/etc/localtime:ro
Expand All @@ -135,12 +150,13 @@ services:
- WEB3SIGNER=${WEB3SIGNER:-false}
- CL_NODE=${CL_NODE}
depends_on:
- consensus
- validator
entrypoint:
- keymanager.sh
- /var/lib/nimbus/api-token.txt
- consensus
- vc

volumes:
nimbus-data:
nimbus-consensus-data:
nimbus-vc-data:
jwtsecret:
Loading

0 comments on commit d23f416

Please sign in to comment.