Skip to content

Commit

Permalink
Use JWT from staker tools (#1)
Browse files Browse the repository at this point in the history
* Use JWT from staker tools

* Remove execution global envs
  • Loading branch information
dappnodedev authored Aug 8, 2024
1 parent 0cf6739 commit 6ea2f35
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 29 deletions.
3 changes: 1 addition & 2 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
6 changes: 4 additions & 2 deletions beacon-chain/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#!/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"

# 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
Expand Down
1 change: 0 additions & 1 deletion beacon-chain/jwtsecret.hex

This file was deleted.

8 changes: 1 addition & 7 deletions package_variants/gnosis/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}
}
6 changes: 1 addition & 5 deletions package_variants/holesky/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}
8 changes: 1 addition & 7 deletions package_variants/lukso/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}
}
6 changes: 1 addition & 5 deletions package_variants/mainnet/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}

0 comments on commit 6ea2f35

Please sign in to comment.