Skip to content

Commit

Permalink
Fix sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed Aug 9, 2024
1 parent d76ce6e commit 4b3a29a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
16 changes: 11 additions & 5 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ RUN mkdir /deps && \
apt-get --yes install wget

ENV LUKSO_CONFIG_PATH=/configs/lukso \
LUKSO_SHARED_CONFIG_URL=https://raw.githubusercontent.com/lukso-network/network-configs/main/mainnet/shared
LUKSO_SHARED_CONFIG_URL=https://raw.githubusercontent.com/lukso-network/network-configs/main/mainnet/shared \
SEPOLIA_CONFIG_PATH=/configs/sepolia \
SEPOLIA_GENESIS_URL=https://raw.githubusercontent.com/eth-clients/sepolia/main/metadata/genesis.ssz

RUN mkdir -p ${LUKSO_CONFIG_PATH} && \

RUN mkdir -p ${LUKSO_CONFIG_PATH} ${SEPOLIA_CONFIG_PATH} && \
if [ "${NETWORK}" = "lukso" ]; then \
wget ${LUKSO_SHARED_CONFIG_URL}/genesis.ssz -O ${LUKSO_CONFIG_PATH}/genesis.ssz && \
wget ${LUKSO_SHARED_CONFIG_URL}/config.yaml -O ${LUKSO_CONFIG_PATH}/config.yaml; \
elif [ "${NETWORK}" = "sepolia" ]; then \
wget ${SEPOLIA_GENESIS_URL} -O ${SEPOLIA_CONFIG_PATH}/genesis.ssz; \
fi

ARG UPSTREAM_VERSION
Expand All @@ -32,7 +37,7 @@ ENV JWT_FILE_PATH=/jwtsecret.hex \
P2P_TCP_PORT=${P2P_TCP_PORT} \
P2P_UDP_PORT=${P2P_UDP_PORT} \
DATA_DIR=${DATA_DIR} \
LUKSO_CONFIG_PATH=/configs/lukso \
CONFIGS_PATH=/configs \
STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION}

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
Expand All @@ -50,7 +55,8 @@ RUN chmod +rx /usr/local/bin/entrypoint.sh /etc/profile.d/consensus_tools.sh
# This env changes the variant
# Placed at the end to regenerate the least amount of layers
ENV NETWORK=${NETWORK} \
LUKSO_GENESIS_FILE_PATH=${LUKSO_CONFIG_PATH}/genesis.ssz \
LUKSO_CHAIN_CONFIG_FILE_PATH=${LUKSO_CONFIG_PATH}/config.yaml
SEPOLIA_GENESIS_FILE_PATH=${CONFIGS_PATH}/sepolia/genesis.ssz \
LUKSO_GENESIS_FILE_PATH=${CONFIGS_PATH}/lukso/genesis.ssz \
LUKSO_CHAIN_CONFIG_FILE_PATH=${CONFIGS_PATH}/lukso/config.yaml

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
14 changes: 11 additions & 3 deletions beacon-chain/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,17 @@ case "$NETWORK" in
esac

# Check if network is lukso and checkpoint sync url is empty
if [ "${NETWORK}" = "lukso" ] && [ -z "${CHECKPOINT_SYNC_URL}" ]; then
echo "[INFO - entrypoint] Syncing LUKSO chain from genesis"
EXTRA_OPTS=$(add_flag_to_extra_opts_safely "${EXTRA_OPTS}" "--genesis-state=${LUKSO_GENESIS_FILE_PATH}")
if [ -z "${CHECKPOINT_SYNC_URL}" ]; then

if [ "${NETWORK}" = "lukso" ]; then
echo "[INFO - entrypoint] Syncing LUKSO chain from genesis"
EXTRA_OPTS=$(add_flag_to_extra_opts_safely "${EXTRA_OPTS}" "--genesis-state=${LUKSO_GENESIS_FILE_PATH}")

elif [ "${NETWORK}" = "sepolia" ]; then
echo "[INFO - entrypoint] Syncing sepolia chain from genesis"
EXTRA_OPTS=$(add_flag_to_extra_opts_safely "${EXTRA_OPTS}" "--genesis-state=${SEPOLIA_GENESIS_FILE_PATH}")
fi

else
# Prysm needs these 2 flags to be set for checkpoint sync
checkpoint_flag_1=$(get_checkpoint_sync_flag "${CHECKPOINT_SYNC_FLAG_KEY_1}" "${CHECKPOINT_SYNC_URL}")
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
DATA_DIR: /root/.eth2validators
volumes:
- "validator-data:/root/.eth2validators"
restart: unless-stopped
restart: on-failure
environment:
LOG_TYPE: INFO
GRAFFITI: validating_from_DAppNode
Expand Down
5 changes: 3 additions & 2 deletions setup-wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ fields:
service: beacon-chain
title: Checkpoint for fast sync
description: >-
To get Prysm up and running in only a few minutes, you can start Prysm from a recent finalized checkpoint state rather than syncing from genesis. This is substantially **faster** and consumes **less resources** than syncing from genesis, while still providing all the same features. Be sure you are using a trusted node for the fast sync. Check the [Prysm docs](https://docs.prylabs.network/docs/prysm-usage/checkpoint-sync) for more information.
Use the Dappnode Official endpoint for your network (`https://checkpoint-sync.dappnode.io`, `https://checkpoint-sync-holesky.dappnode.io`, `https://checkpoint-sync-gnosis.dappnode.io`) or get your checkpoint sync from [Infura](https://infura.io/) (i.e https://[email protected]). For LUKSO, use their official endpoint (`https://checkpoints.mainnet.lukso.network`).
To get Prysm up and running in only a few minutes, use the Dappnode Official endpoint for your network (`https://checkpoint-sync.dappnode.io`, `https://checkpoint-sync-holesky.dappnode.io`, `https://checkpoint-sync-gnosis.dappnode.io`) or get your checkpoint sync from [Infura](https://infura.io/) (i.e https://[email protected]).
For LUKSO, use their official endpoint (`https://checkpoints.mainnet.lukso.network`).
For Sepolia, you can use Lodestar checkpoint sync endpoint (`https://beaconstate-sepolia.chainsafe.io`).
*Note - If you are going to provide your own checkpoint sync endpoint, make sure you do not use a slash `/` at the end of the URL.*
required: false
- id: feeRecipientAddress
Expand Down
7 changes: 6 additions & 1 deletion validator/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh

if [ "$NETWORK" = "sepolia" ]; then
echo "[INFO - entrypoint] sepolia network does not require validator service"
exit 0
fi

SUPPORTED_NETWORKS="sepolia lukso holesky mainnet"
MEVBOOST_FLAG_KEY="--enable-builder"
SKIP_MEVBOOST_URL="true"
Expand All @@ -14,7 +19,7 @@ SIGNER_API_URL=$(get_signer_api_url "${NETWORK}" "${SUPPORTED_NETWORKS}")
BEACON_API_URL=$(get_beacon_api_url "${NETWORK}" "${SUPPORTED_NETWORKS}" "${CLIENT}")
MEVBOOST_FLAG=$(get_mevboost_flag "${MEVBOOST_FLAG_KEY}" "${SKIP_MEVBOOST_URL}")

# Extract base URL. This assumes BEACON_API_URL will has the following format: http://<domain>:<port>
# Extract base URL. This assumes BEACON_API_URL will has the following format: http://<domain>:<port>
# Example: http://localhost:4000 -> localhost
BEACON_DOMAIN="$(echo "$BEACON_API_URL" | cut -d'/' -f3 | cut -d':' -f1)"

Expand Down

0 comments on commit 4b3a29a

Please sign in to comment.