Skip to content

Commit

Permalink
Some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed Jul 5, 2024
1 parent f9156ea commit 3be0297
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
3 changes: 1 addition & 2 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ RUN apk update && apk add --no-cache curl

ENV JWT_SECRET_FILE=/jwtsecret \
DATA_DIR=/var/lib/data \
BEACON_API_PORT=3500 \
NETWORK=${NETWORK} \
STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION}

ADD ${STAKER_SCRIPTS_URL}/consensus_tools.sh /etc/profile.d/

RUN chmod +rx /usr/local/bin/entrypoint.sh /etc/profile.d/consensus_tools.sh

EXPOSE $BEACON_API_PORT

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
10 changes: 6 additions & 4 deletions beacon-chain/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

SUPPORTED_NETWORKS="gnosis holesky mainnet"
CHECKPOINT_SYNC_FLAG="--checkpointSync"
MEVBOOST_FLAGS="--builder --builder.url"

# shellcheck disable=SC1091 # Path is relative to the Dockerfile
. /etc/profile
Expand All @@ -14,7 +16,7 @@ run_beacon() {
--network=mainnet \
--suggestedFeeRecipient="${FEE_RECIPIENT_ADDRESS}" \
--jwt-secret="${JWT_SECRET_FILE}" \
--execution.urls="${HTTP_ENGINE}" \
--execution.urls="${ENGINE_API_URL}" \
--dataDir="${DATA_DIR}" \
--rest \
--rest.address 0.0.0.0 \
Expand All @@ -29,7 +31,7 @@ run_beacon() {
--logFileDailyRotate 5 ${EXTRA_OPTS:-}
}

set_consensus_config_by_network "${SUPPORTED_NETWORKS}"
set_checkpointsync_url "--checkpointSyncUrl" "${CHECKPOINT_SYNC_URL}"
set_mevboost_flag "--builder --builder.url" # MEV-Boost: https://chainsafe.github.io/lodestar/usage/mev-integration/
set_beacon_config_by_network "${NETWORK}" "${SUPPORTED_NETWORKS}"
set_checkpointsync_url "${CHECKPOINT_SYNC_FLAG}" "${CHECKPOINT_SYNC_URL}"
set_mevboost_flag "${MEVBOOST_FLAGS}" # MEV-Boost: https://chainsafe.github.io/lodestar/usage/mev-integration/
run_beacon
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ services:
- seccomp:unconfined
environment:
DEBUG_LEVEL: info
BEACON_API_PORT: 3500
CHECKPOINT_SYNC_URL: ""
EXTRA_OPTS: ""
FEE_RECIPIENT_ADDRESS: ""
Expand All @@ -31,8 +30,6 @@ services:
- seccomp:unconfined
environment:
DEBUG_LEVEL: info
HTTP_WEB3SIGNER: http://web3signer.web3signer.dappnode:9000
BEACON_NODE_ADDR: http://beacon-chain.lodestar.dappnode:3500
GRAFFITI: validating_from_DAppNode
EXTRA_OPTS: ""
FEE_RECIPIENT_ADDRESS: ""
Expand Down
14 changes: 10 additions & 4 deletions validator/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/sh

SUPPORTED_NETWORKS="gnosis holesky mainnet"
MEVBOOST_FLAG="--builder"
SKIP_MEVBOOST_URL="true"
CLIENT="lodestar"

# shellcheck disable=SC1091
. /etc/profile

run_validator() {
echo "[INFO - entrypoint] Running validator node"
echo "[INFO - entrypoint] Running validator service"

# shellcheck disable=SC2086
exec node /usr/app/node_modules/.bin/lodestar \
Expand All @@ -20,15 +25,16 @@ run_validator() {
--metrics \
--metrics.port 5064 \
--metrics.address 0.0.0.0 \
--externalSigner.url="${HTTP_WEB3SIGNER}" \
--externalSigner.url="${WEB3SIGNER_API_URL}" \
--doppelgangerProtection="${DOPPELGANGER_PROTECTION}" \
--beaconNodes="${BEACON_NODE_ADDR}" \
--beaconNodes="${BEACON_API_URL}" \
--logLevel="${DEBUG_LEVEL}" \
--logFileLevel=debug \
--logFileDailyRotate 5 \
--logFile /var/lib/data/validator.log ${EXTRA_OPTS}
}

format_graffiti
set_mevboost_flag "--builder" "true" # MEV-Boost: https://chainsafe.github.io/lodestar/usage/mev-integration/
set_validator_config_by_network "${NETWORK}" "${SUPPORTED_NETWORKS}" "${CLIENT}"
set_mevboost_flag "${MEVBOOST_FLAG}" "${SKIP_MEVBOOST_URL}" # MEV-Boost: https://chainsafe.github.io/lodestar/usage/mev-integration/
run_validator

0 comments on commit 3be0297

Please sign in to comment.