From 6ea2f352b9ed6aae2e64555897178c25e45d947e Mon Sep 17 00:00:00 2001 From: dappnodedev <144998261+dappnodedev@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:19:50 +0200 Subject: [PATCH] Use JWT from staker tools (#1) * Use JWT from staker tools * Remove execution global envs --- beacon-chain/Dockerfile | 3 +-- beacon-chain/entrypoint.sh | 6 ++++-- beacon-chain/jwtsecret.hex | 1 - package_variants/gnosis/dappnode_package.json | 8 +------- package_variants/holesky/dappnode_package.json | 6 +----- package_variants/lukso/dappnode_package.json | 8 +------- package_variants/mainnet/dappnode_package.json | 6 +----- 7 files changed, 9 insertions(+), 29 deletions(-) delete mode 100644 beacon-chain/jwtsecret.hex diff --git a/beacon-chain/Dockerfile b/beacon-chain/Dockerfile index ea5bbc8..ab394e7 100644 --- a/beacon-chain/Dockerfile +++ b/beacon-chain/Dockerfile @@ -7,13 +7,12 @@ ARG P2P_PORT ARG DATA_DIR ARG STAKER_SCRIPTS_VERSION -ENV JWT_SECRET_FILE=/jwtsecret \ +ENV JWT_SECRET_FILE=/jwtsecret.hex \ P2P_PORT=${P2P_PORT} \ DATA_DIR=${DATA_DIR} \ STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION} COPY entrypoint.sh /usr/local/bin/entrypoint.sh -COPY jwtsecret.hex ${JWT_SECRET_FILE} ADD ${STAKER_SCRIPTS_URL}/consensus_tools.sh /etc/profile.d/ diff --git a/beacon-chain/entrypoint.sh b/beacon-chain/entrypoint.sh index 74d3fb6..c540c92 100755 --- a/beacon-chain/entrypoint.sh +++ b/beacon-chain/entrypoint.sh @@ -1,6 +1,5 @@ #!/bin/sh -SUPPORTED_NETWORKS="gnosis holesky mainnet lukso" CHECKPOINT_SYNC_FLAG="--initial-state" MEVBOOST_FLAG_KEYS="--builder-endpoint" TEKU_FORMAT_CHECKPOINT_URL="$(echo "${CHECKPOINT_SYNC_URL}" | sed 's:/*$::')/eth/v2/debug/beacon/states/finalized" @@ -8,11 +7,14 @@ TEKU_FORMAT_CHECKPOINT_URL="$(echo "${CHECKPOINT_SYNC_URL}" | sed 's:/*$::')/eth # shellcheck disable=SC1091 # Path is relative to the Dockerfile . /etc/profile -ENGINE_URL=$(get_engine_api_url "${NETWORK}" "${SUPPORTED_NETWORKS}") +ENGINE_URL="http://execution.${NETWORK}.staker.dappnode:8551" VALID_FEE_RECIPIENT=$(get_valid_fee_recipient "${FEE_RECIPIENT}") CHECKPOINT_SYNC_FLAG=$(get_checkpoint_sync_flag "${CHECKPOINT_SYNC_FLAG}" "${TEKU_FORMAT_CHECKPOINT_URL}") MEVBOOST_FLAG=$(get_mevboost_flag "${NETWORK}" "${MEVBOOST_FLAG_KEYS}") +JWT_SECRET=$(get_jwt_secret_by_network "${NETWORK}") +echo "${JWT_SECRET}" >"${JWT_FILE_PATH}" + echo "[INFO - entrypoint] Starting beacon node" # shellcheck disable=SC2086 diff --git a/beacon-chain/jwtsecret.hex b/beacon-chain/jwtsecret.hex deleted file mode 100644 index 9ef7300..0000000 --- a/beacon-chain/jwtsecret.hex +++ /dev/null @@ -1 +0,0 @@ -7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d19 \ No newline at end of file diff --git a/package_variants/gnosis/dappnode_package.json b/package_variants/gnosis/dappnode_package.json index 0d80b46..2b28c70 100644 --- a/package_variants/gnosis/dappnode_package.json +++ b/package_variants/gnosis/dappnode_package.json @@ -6,11 +6,5 @@ "homepage": "https://docs.teku.consensys.net", "readme": "https://github.com/ConsenSys/teku/blob/master/README.md", "docs": "https://docs.teku.consensys.net" - }, - "globalEnvs": [ - { - "envs": ["EXECUTION_CLIENT_GNOSIS"], - "services": ["beacon-chain"] - } - ] + } } diff --git a/package_variants/holesky/dappnode_package.json b/package_variants/holesky/dappnode_package.json index b47e25b..0d20a6a 100644 --- a/package_variants/holesky/dappnode_package.json +++ b/package_variants/holesky/dappnode_package.json @@ -8,13 +8,9 @@ "docs": "https://docs.teku.consensys.net" }, "globalEnvs": [ - { - "envs": ["EXECUTION_CLIENT_HOLESKY", "MEVBOOST_HOLESKY"], - "services": ["beacon-chain"] - }, { "envs": ["MEVBOOST_HOLESKY"], - "services": ["validator"] + "services": ["validator", "beacon-chain"] } ] } diff --git a/package_variants/lukso/dappnode_package.json b/package_variants/lukso/dappnode_package.json index f892d0a..039db78 100644 --- a/package_variants/lukso/dappnode_package.json +++ b/package_variants/lukso/dappnode_package.json @@ -6,11 +6,5 @@ "homepage": "https://docs.teku.consensys.net", "readme": "https://github.com/ConsenSys/teku/blob/master/README.md", "docs": "https://docs.teku.consensys.net" - }, - "globalEnvs": [ - { - "envs": ["EXECUTION_CLIENT_LUKSO"], - "services": ["beacon-chain"] - } - ] + } } diff --git a/package_variants/mainnet/dappnode_package.json b/package_variants/mainnet/dappnode_package.json index 738379f..88cbffb 100644 --- a/package_variants/mainnet/dappnode_package.json +++ b/package_variants/mainnet/dappnode_package.json @@ -8,13 +8,9 @@ "docs": "https://docs.teku.consensys.net" }, "globalEnvs": [ - { - "envs": ["EXECUTION_CLIENT_MAINNET", "MEVBOOST_MAINNET"], - "services": ["beacon-chain"] - }, { "envs": ["MEVBOOST_MAINNET"], - "services": ["validator"] + "services": ["validator", "beacon-chain"] } ] }