From d75e8728db64daf958bb3b275dfee2b49074aaf6 Mon Sep 17 00:00:00 2001 From: b0a7 <127276179+b0a7@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:43:47 -0400 Subject: [PATCH 1/4] separate yml files docker compose --env-file ./.env -f examples/network.yml -f examples/charon.yml -f examples/monitoring.yml -f examples/teku-vc.yml up -d --build --- examples/charon.yml | 30 ++++++++++++++++++++++++++++++ examples/monitoring.yml | 32 ++++++++++++++++++++++++++++++++ examples/network.yml | 4 ++++ examples/teku-vc.yml | 33 +++++++++++++++++++++++++++++++++ teku/docker-entrypoint-vc.sh | 14 ++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 examples/charon.yml create mode 100644 examples/monitoring.yml create mode 100644 examples/network.yml create mode 100644 examples/teku-vc.yml create mode 100644 teku/docker-entrypoint-vc.sh diff --git a/examples/charon.yml b/examples/charon.yml new file mode 100644 index 0000000..aabbe1d --- /dev/null +++ b/examples/charon.yml @@ -0,0 +1,30 @@ +# Override any defaults specified by `${FOO:-bar}` in `.env` with `FOO=qux`. +# ${VARIABLE:-default} evaluates to default if VARIABLE is unset or empty in the environment. +# ${VARIABLE-default} evaluates to default only if VARIABLE is unset in the environment. + +services: + # _ + # ___| |__ __ _ _ __ ___ _ __ + # / __| '_ \ / _` | '__/ _ \| '_ \ + # | (__| | | | (_| | | | (_) | | | | + # \___|_| |_|\__,_|_| \___/|_| |_| + + charon: + image: obolnetwork/charon:${CHARON_VERSION:-v1.0.1} + environment: + - CHARON_BEACON_NODE_ENDPOINTS=${CHARON_BEACON_NODE_ENDPOINTS:-http://eth2_bn:5052} + - CHARON_LOG_LEVEL=${CHARON_LOG_LEVEL:-info} + - CHARON_LOG_FORMAT=${CHARON_LOG_FORMAT:-console} + - CHARON_P2P_RELAYS=${CHARON_P2P_RELAYS:-https://0.relay.obol.tech} + - CHARON_P2P_EXTERNAL_HOSTNAME=${CHARON_P2P_EXTERNAL_HOSTNAME:-} # Empty default required to avoid warnings. + - CHARON_P2P_TCP_ADDRESS=0.0.0.0:${CHARON_PORT_P2P_TCP:-3610} + - CHARON_VALIDATOR_API_ADDRESS=0.0.0.0:3600 + - CHARON_MONITORING_ADDRESS=0.0.0.0:3620 + - CHARON_BUILDER_API=${BUILDER_API_ENABLED:-false} + ports: + - ${CHARON_PORT_P2P_TCP:-3610}:${CHARON_PORT_P2P_TCP:-3610}/tcp # P2P TCP libp2p + volumes: + - ../.charon:/opt/charon/.charon + restart: unless-stopped + healthcheck: + test: wget -qO- http://localhost:3620/readyz diff --git a/examples/monitoring.yml b/examples/monitoring.yml new file mode 100644 index 0000000..8453d0e --- /dev/null +++ b/examples/monitoring.yml @@ -0,0 +1,32 @@ +# Override any defaults specified by `${FOO:-bar}` in `.env` with `FOO=qux`. +# ${VARIABLE:-default} evaluates to default if VARIABLE is unset or empty in the environment. +# ${VARIABLE-default} evaluates to default only if VARIABLE is unset in the environment. + +services: + # _ _ _ + # _ __ ___ ___ _ __ (_) |_ ___ _ __(_)_ __ __ _ + # | '_ ` _ \ / _ \| '_ \| | __/ _ \| '__| | '_ \ / _` | + # | | | | | | (_) | | | | | || (_) | | | | | | | (_| | + # |_| |_| |_|\___/|_| |_|_|\__\___/|_| |_|_| |_|\__, | + # |___/ + + prometheus: + image: prom/prometheus:${PROMETHEUS_VERSION:-v2.43.0} + user: ":" + volumes: + - ../prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - ../data/prometheus:/prometheus + restart: unless-stopped + + grafana: + image: grafana/grafana:${GRAFANA_VERSION:-9.4.7} + user: ":" + ports: + - ${MONITORING_PORT_GRAFANA:-3000}:3000 + volumes: + - ../grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml + - ../grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/datasource.yml + - ../grafana/grafana.ini:/etc/grafana/grafana.ini:ro + - ../grafana/dashboards:/etc/dashboards + - ../data/grafana:/var/lib/grafana + restart: unless-stopped diff --git a/examples/network.yml b/examples/network.yml new file mode 100644 index 0000000..a63f057 --- /dev/null +++ b/examples/network.yml @@ -0,0 +1,4 @@ +networks: + default: + name: rocketpool_net + external: true \ No newline at end of file diff --git a/examples/teku-vc.yml b/examples/teku-vc.yml new file mode 100644 index 0000000..576d899 --- /dev/null +++ b/examples/teku-vc.yml @@ -0,0 +1,33 @@ +# Override any defaults specified by `${FOO:-bar}` in `.env` with `FOO=qux`. +# ${VARIABLE:-default} evaluates to default if VARIABLE is unset or empty in the environment. +# ${VARIABLE-default} evaluates to default only if VARIABLE is unset in the environment. + +services: + # | | | | + # | |_ ___| | ___ _ + # | __/ _ \ |/ / | | | + # | || __/ <| |_| | + # \__\___|_|\_\\__,_| + teku-vc: + image: consensys/teku:${TEKU_VERSION:-24.8.0} + depends_on: [ charon ] + restart: unless-stopped + environment: + - NETWORK=${NETWORK:-auto} + - BUILDER_API_ENABLED=${BUILDER_API_ENABLED:-false} + - FEE_RECIPIENT=${FEE_RECIPIENT:-0x0000000000000000000000000000000000000000} + entrypoint: + - /opt/charon/teku/docker-entrypoint-vc.sh + - /opt/teku/bin/teku + - validator-client + - --beacon-node-api-endpoints=http://charon:3600 + - --log-destination=CONSOLE + - --validator-keys=/opt/charon/validator_keys:/opt/charon/validator_keys + - --validators-keystore-locking-enabled=false + - --metrics-enabled=true + - --metrics-port=8008 + - --metrics-interface=0.0.0.0 + - --metrics-host-allowlist=* + volumes: + - ../.charon/validator_keys:/opt/charon/validator_keys + - ../teku:/opt/charon/teku diff --git a/teku/docker-entrypoint-vc.sh b/teku/docker-entrypoint-vc.sh new file mode 100644 index 0000000..afa5435 --- /dev/null +++ b/teku/docker-entrypoint-vc.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +__network="--network=${NETWORK}" + +if [ "${BUILDER_API_ENABLED}" = "true" ]; then + __mev_boost="--validators-builder-registration-default-enabled --validators-proposer-blinded-blocks-enabled" + echo "MEV Boost enabled" +else + __mev_boost="" +fi + +__fee_recipient="--validators-proposer-default-fee-recipient=${FEE_RECIPIENT}" + +exec "$@" ${__network} ${__mev_boost} ${__fee_recipient} \ No newline at end of file From 5bba529250e639218a6f9b8be6f7ca97b743a2a9 Mon Sep 17 00:00:00 2001 From: b0a7 <127276179+b0a7@users.noreply.github.com> Date: Sat, 10 Aug 2024 16:31:26 -0400 Subject: [PATCH 2/4] separate network and rocketpool_net yml files. Just pick one --- examples/network.yml | 8 ++++++-- examples/rocketpool_net.yml | 11 +++++++++++ examples/teku-vc.yml | 2 +- teku/docker-entrypoint-vc.sh | 14 -------------- teku/run-vc.sh | 14 ++++++++++++++ 5 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 examples/rocketpool_net.yml delete mode 100644 teku/docker-entrypoint-vc.sh create mode 100644 teku/run-vc.sh diff --git a/examples/network.yml b/examples/network.yml index a63f057..564f94e 100644 --- a/examples/network.yml +++ b/examples/network.yml @@ -1,4 +1,8 @@ +# The "Multiple Compose File" feature provides a very powerful way to override +# any configuration in docker-compose.yml without needing to modify +# git-checked-in files since that results in conflicts when upgrading this repo. +# See https://docs.docker.com/compose/extends/#multiple-compose-files for more. + networks: default: - name: rocketpool_net - external: true \ No newline at end of file + name: dvnode diff --git a/examples/rocketpool_net.yml b/examples/rocketpool_net.yml new file mode 100644 index 0000000..4914687 --- /dev/null +++ b/examples/rocketpool_net.yml @@ -0,0 +1,11 @@ +# The "Multiple Compose File" feature provides a very powerful way to override +# any configuration in docker-compose.yml without needing to modify +# git-checked-in files since that results in conflicts when upgrading this repo. +# See https://docs.docker.com/compose/extends/#multiple-compose-files for more. + +# set CHARON_BEACON_NODE_ENDPOINTS="http://rocketpool_eth2:5052" in .env + +networks: + default: + name: rocketpool_net + external: true diff --git a/examples/teku-vc.yml b/examples/teku-vc.yml index 576d899..5a9c7f2 100644 --- a/examples/teku-vc.yml +++ b/examples/teku-vc.yml @@ -17,7 +17,7 @@ services: - BUILDER_API_ENABLED=${BUILDER_API_ENABLED:-false} - FEE_RECIPIENT=${FEE_RECIPIENT:-0x0000000000000000000000000000000000000000} entrypoint: - - /opt/charon/teku/docker-entrypoint-vc.sh + - /opt/charon/teku/run-vc.sh - /opt/teku/bin/teku - validator-client - --beacon-node-api-endpoints=http://charon:3600 diff --git a/teku/docker-entrypoint-vc.sh b/teku/docker-entrypoint-vc.sh deleted file mode 100644 index afa5435..0000000 --- a/teku/docker-entrypoint-vc.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -__network="--network=${NETWORK}" - -if [ "${BUILDER_API_ENABLED}" = "true" ]; then - __mev_boost="--validators-builder-registration-default-enabled --validators-proposer-blinded-blocks-enabled" - echo "MEV Boost enabled" -else - __mev_boost="" -fi - -__fee_recipient="--validators-proposer-default-fee-recipient=${FEE_RECIPIENT}" - -exec "$@" ${__network} ${__mev_boost} ${__fee_recipient} \ No newline at end of file diff --git a/teku/run-vc.sh b/teku/run-vc.sh new file mode 100644 index 0000000..6eb7a56 --- /dev/null +++ b/teku/run-vc.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +_network="--network=${NETWORK}" + +if [ "${BUILDER_API_ENABLED}" = "true" ]; then + echo "MEV Boost enabled" + _mev_boost="--validators-builder-registration-default-enabled --validators-proposer-blinded-blocks-enabled" +else + _mev_boost="" +fi + +_fee_recipient="--validators-proposer-default-fee-recipient=${FEE_RECIPIENT}" + +exec "$@" ${_network} ${_mev_boost} ${_fee_recipient} From 02a8870ab5af2fbaff4d38a42bd1c5285709be7a Mon Sep 17 00:00:00 2001 From: b0a7 <127276179+b0a7@users.noreply.github.com> Date: Sun, 11 Aug 2024 21:21:42 -0400 Subject: [PATCH 3/4] teku Xobol-dvt-integration-enabled --- examples/teku-vc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/teku-vc.yml b/examples/teku-vc.yml index 5a9c7f2..e101c3e 100644 --- a/examples/teku-vc.yml +++ b/examples/teku-vc.yml @@ -28,6 +28,7 @@ services: - --metrics-port=8008 - --metrics-interface=0.0.0.0 - --metrics-host-allowlist=* + - --Xobol-dvt-integration-enabled=true volumes: - ../.charon/validator_keys:/opt/charon/validator_keys - ../teku:/opt/charon/teku From 83ccbc324603a8fbb2643b085763cfdca088f32b Mon Sep 17 00:00:00 2001 From: b0a7 <127276179+b0a7@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:52:55 -0400 Subject: [PATCH 4/4] update networking yml file comments --- examples/network.yml | 6 ++---- examples/rocketpool_net.yml | 8 ++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/network.yml b/examples/network.yml index 564f94e..424b5b9 100644 --- a/examples/network.yml +++ b/examples/network.yml @@ -1,7 +1,5 @@ -# The "Multiple Compose File" feature provides a very powerful way to override -# any configuration in docker-compose.yml without needing to modify -# git-checked-in files since that results in conflicts when upgrading this repo. -# See https://docs.docker.com/compose/extends/#multiple-compose-files for more. +# include this file to link various other services together such as your validator client, charon, your eth1 and eth2 clients, prometheus, and grafana +# if you are using a RocketPool reverse-hybrid configuration include rocketpool_net.yml instead of this file networks: default: diff --git a/examples/rocketpool_net.yml b/examples/rocketpool_net.yml index 4914687..a2ddcb0 100644 --- a/examples/rocketpool_net.yml +++ b/examples/rocketpool_net.yml @@ -1,9 +1,5 @@ -# The "Multiple Compose File" feature provides a very powerful way to override -# any configuration in docker-compose.yml without needing to modify -# git-checked-in files since that results in conflicts when upgrading this repo. -# See https://docs.docker.com/compose/extends/#multiple-compose-files for more. - -# set CHARON_BEACON_NODE_ENDPOINTS="http://rocketpool_eth2:5052" in .env +# include this file instead of network.yml file if you are using a RocketPool reverse-hybrid configuration +# to get Charon to use the RocketPool eth2 client, set CHARON_BEACON_NODE_ENDPOINTS="http://rocketpool_eth2:5052" in .env networks: default: