-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6090b1a
commit b108bce
Showing
6 changed files
with
131 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,67 @@ | ||
#!/bin/sh | ||
|
||
SUPPORTED_NETWORKS="sepolia lukso holesky mainnet" | ||
CHECKPOINT_SYNC_FLAG_1="--checkpoint-sync-url" | ||
CHECKPOINT_SYNC_FLAG_2="--genesis-beacon-api-url" | ||
MEVBOOST_FLAGS="--http-mev-relay" | ||
CHECKPOINT_SYNC_FLAG_KEY_1="--checkpoint-sync-url" | ||
CHECKPOINT_SYNC_FLAG_KEY_2="--genesis-beacon-api-url" | ||
MEVBOOST_FLAG_KEY="--http-mev-relay" | ||
|
||
# shellcheck disable=SC1091 # Path is relative to the Dockerfile | ||
. /etc/profile | ||
. /etc/profile.d/consensus_tools.sh | ||
|
||
handle_network() { | ||
case "$NETWORK" in | ||
"holesky") | ||
flags_to_set="--holesky" | ||
;; | ||
"lukso") | ||
flags_to_set="--chain-config-file=$LUKSO_CONFIG_PATH --contract-deployment-block=0 --bootstrap-node=enr:-MK4QJ-Bt9HATy4GQawPbDDTArtnt_phuWiVVoWKhS7-DSNjVzmGKBI9xKzpyRtpeCWd3qA9737FTdkKGDgtHfF4N-6GAYlzJCVRh2F0dG5ldHOIAAAAAAAAAACEZXRoMpA2ulfbQgAABP__________gmlkgnY0gmlwhCKTScGJc2VjcDI1NmsxoQJNpNUERqKhA8eDDC4tovG3a59NXVOW16JDFAWXoFFTEYhzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A","enr:-MK4QDOs4pISOkkYbVHnGYHC5EhYCsVzwguun6sFZjLTqrY6Kx_AoE-YyHvqBIHDUwyQqESC4-B3o6DigPQNfKpdhXiGAYgmPWCdh2F0dG5ldHOIAAAAAAAAAACEZXRoMpA2ulfbQgAABP__________gmlkgnY0gmlwhCIgwNOJc2VjcDI1NmsxoQNGVC8JPcsqsZPoohLP1ujAYpBfS0dBwiz4LeoUQ-k5OohzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A" | ||
;; | ||
"mainnet") | ||
flags_to_set="--mainnet" | ||
;; | ||
"sepolia") | ||
flags_to_set="--sepolia" | ||
;; | ||
*) | ||
echo "[ERROR - entrypoint] Unsupported network: $NETWORK" | ||
exit 1 | ||
;; | ||
esac | ||
ENGINE_URL=$(get_engine_api_url "${NETWORK}" "${SUPPORTED_NETWORKS}") | ||
VALID_FEE_RECIPIENT=$(get_valid_fee_recipient "${FEE_RECIPIENT}") | ||
MEVBOOST_FLAG=$(get_mevboost_flag "${NETWORK}" "${MEVBOOST_FLAG_KEY}") | ||
|
||
set_beacon_config_by_network "${NETWORK}" "${SUPPORTED_NETWORKS}" "$flags_to_set" | ||
} | ||
# To avoid failure for users who have added fee recipient to extra opts | ||
EXTRA_OPTS=$(add_flag_to_extra_opts_safely "${EXTRA_OPTS}" "--suggested-fee-recipient=${VALID_FEE_RECIPIENT}") | ||
|
||
handle_checkpoint() { | ||
# 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" | ||
add_flag_to_extra_opts "--genesis-state=${LUKSO_GENESIS_FILE_PATH}" | ||
else | ||
# Prysm needs these 2 flags to be set for checkpoint sync | ||
set_checkpointsync_url "${CHECKPOINT_SYNC_FLAG_1}" "${CHECKPOINT_SYNC_URL}" | ||
set_checkpointsync_url "${CHECKPOINT_SYNC_FLAG_2}" "${CHECKPOINT_SYNC_URL}" | ||
fi | ||
} | ||
case "$NETWORK" in | ||
"holesky") | ||
NETWORK_FLAGS="--holesky" | ||
;; | ||
"lukso") | ||
NETWORK_FLAGS="--chain-config-file=$LUKSO_CONFIG_PATH --contract-deployment-block=0 --bootstrap-node=enr:-MK4QJ-Bt9HATy4GQawPbDDTArtnt_phuWiVVoWKhS7-DSNjVzmGKBI9xKzpyRtpeCWd3qA9737FTdkKGDgtHfF4N-6GAYlzJCVRh2F0dG5ldHOIAAAAAAAAAACEZXRoMpA2ulfbQgAABP__________gmlkgnY0gmlwhCKTScGJc2VjcDI1NmsxoQJNpNUERqKhA8eDDC4tovG3a59NXVOW16JDFAWXoFFTEYhzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A","enr:-MK4QDOs4pISOkkYbVHnGYHC5EhYCsVzwguun6sFZjLTqrY6Kx_AoE-YyHvqBIHDUwyQqESC4-B3o6DigPQNfKpdhXiGAYgmPWCdh2F0dG5ldHOIAAAAAAAAAACEZXRoMpA2ulfbQgAABP__________gmlkgnY0gmlwhCIgwNOJc2VjcDI1NmsxoQNGVC8JPcsqsZPoohLP1ujAYpBfS0dBwiz4LeoUQ-k5OohzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A" | ||
;; | ||
"mainnet") | ||
NETWORK_FLAGS="--mainnet" | ||
;; | ||
"sepolia") | ||
NETWORK_FLAGS="--sepolia" | ||
;; | ||
*) | ||
echo "[ERROR - entrypoint] Unsupported network: $NETWORK" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
run_beacon() { | ||
echo "[INFO - entrypoint] Running beacon service" | ||
# 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}") | ||
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}") | ||
checkpoint_flag_2=$(get_checkpoint_sync_flag "${CHECKPOINT_SYNC_FLAG_KEY_2}" "${CHECKPOINT_SYNC_URL}") | ||
|
||
# shellcheck disable=SC2086 | ||
exec /beacon-chain \ | ||
--accept-terms-of-use \ | ||
--datadir=${DATA_DIR} \ | ||
--jwt-secret="${JWT_FILE_PATH}" \ | ||
--execution-endpoint="${ENGINE_API_URL}" \ | ||
--monitoring-host=0.0.0.0 \ | ||
--grpc-gateway-host=0.0.0.0 \ | ||
--grpc-gateway-port="${BEACON_API_PORT}" \ | ||
--grpc-gateway-corsdomain="${CORSDOMAIN}" \ | ||
--rpc-host=0.0.0.0 \ | ||
--verbosity="${VERBOSITY}" \ | ||
--p2p-tcp-port="${P2P_TCP_PORT}" \ | ||
--p2p-udp-port="${P2P_UDP_PORT}" \ | ||
--p2p-max-peers="${MAX_PEERS}" \ | ||
--min-sync-peers="${MIN_SYNC_PEERS}" \ | ||
--subscribe-all-subnets="${SUBSCRIBE_ALL_SUBNETS}" ${EXTRA_OPTS} | ||
} | ||
CHECKPOINT_SYNC_FLAGS="${checkpoint_flag_1} ${checkpoint_flag_2}" | ||
fi | ||
|
||
validate_fee_recipient | ||
handle_network | ||
handle_checkpoint | ||
set_mevboost_flag "${MEVBOOST_FLAGS}" | ||
add_flag_to_extra_opts "--suggested-fee-recipient=${FEE_RECIPIENT}" | ||
run_beacon | ||
echo "[INFO - entrypoint] Running beacon service" | ||
|
||
# shellcheck disable=SC2086 | ||
exec /beacon-chain \ | ||
--accept-terms-of-use \ | ||
--datadir=${DATA_DIR} \ | ||
--jwt-secret="${JWT_FILE_PATH}" \ | ||
--execution-endpoint="${ENGINE_URL}" \ | ||
--monitoring-host=0.0.0.0 \ | ||
--grpc-gateway-host=0.0.0.0 \ | ||
--grpc-gateway-port="${BEACON_API_PORT}" \ | ||
--grpc-gateway-corsdomain="${CORSDOMAIN}" \ | ||
--rpc-host=0.0.0.0 \ | ||
--verbosity="${VERBOSITY}" \ | ||
--p2p-tcp-port="${P2P_TCP_PORT}" \ | ||
--p2p-udp-port="${P2P_UDP_PORT}" \ | ||
--p2p-max-peers="${MAX_PEERS}" \ | ||
--min-sync-peers="${MIN_SYNC_PEERS}" \ | ||
--subscribe-all-subnets="${SUBSCRIBE_ALL_SUBNETS}" ${NETWORK_FLAGS} ${CHECKPOINT_SYNC_FLAGS} ${MEVBOOST_FLAG} ${EXTRA_OPTS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ fields: | |
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 `https://checkpoint-sync.dappnode.io` or get your checkpoint sync from [Infura](https://infura.io/) (i.e https://[email protected]) | ||
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]) | ||
*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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,56 @@ | ||
#!/bin/sh | ||
|
||
SUPPORTED_NETWORKS="sepolia lukso holesky mainnet" | ||
MEVBOOST_FLAG="--enable-builder" | ||
MEVBOOST_FLAG_KEY="--enable-builder" | ||
SKIP_MEVBOOST_URL="true" | ||
CLIENT="prysm" | ||
|
||
handle_network() { | ||
case "$NETWORK" in | ||
"holesky") | ||
flags_to_set="--holesky" | ||
;; | ||
"lukso") | ||
flags_to_set="--chain-config-file=${LUKSO_CONFIG_PATH}" | ||
;; | ||
"mainnet") | ||
flags_to_set="--mainnet" | ||
;; | ||
"sepolia") | ||
flags_to_set="--sepolia" | ||
;; | ||
*) | ||
echo "[ERROR - entrypoint] Unsupported network: $NETWORK" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
set_validator_config_by_network "${NETWORK}" "${SUPPORTED_NETWORKS}" "${CLIENT}" "$flags_to_set" | ||
|
||
} | ||
|
||
get_beacon_rpc_url() { | ||
|
||
beacon_domain_and_protocol=$(echo "$BEACON_API_URL" | cut -d':' -f1,2) | ||
|
||
BEACON_RPC_4000="${beacon_domain_and_protocol}:4000" | ||
} | ||
|
||
run_validator() { | ||
echo "[INFO - entrypoint] Running validator service" | ||
|
||
# shellcheck disable=SC2086 | ||
exec /validator \ | ||
--datadir="${DATA_DIR}" \ | ||
--wallet-dir="${WALLET_DIR}" \ | ||
--monitoring-host 0.0.0.0 \ | ||
--beacon-rpc-provider="${BEACON_API_URL}" \ | ||
--beacon-rpc-gateway-provider="${BEACON_RPC_4000}" \ | ||
--validators-external-signer-url="${WEB3SIGNER_API_URL}" \ | ||
--grpc-gateway-host=0.0.0.0 \ | ||
--grpc-gateway-port="${VALIDATOR_API_PORT}" \ | ||
--grpc-gateway-corsdomain=http://0.0.0.0:"${VALIDATOR_API_PORT}" \ | ||
--graffiti="${GRAFFITI}" \ | ||
--suggested-fee-recipient="${FEE_RECIPIENT}" \ | ||
--verbosity="${VERBOSITY}" \ | ||
--web \ | ||
--accept-terms-of-use \ | ||
--enable-doppelganger ${EXTRA_OPTS} | ||
} | ||
|
||
format_graffiti | ||
handle_network | ||
get_beacon_rpc_url | ||
set_mevboost_flag "${MEVBOOST_FLAG}" "${SKIP_MEVBOOST_URL}" | ||
run_validator | ||
# shellcheck disable=SC1091 | ||
. /etc/profile.d/consensus_tools.sh | ||
|
||
VALID_GRAFFITI=$(get_valid_graffiti "${GRAFFITI}") | ||
VALID_FEE_RECIPIENT=$(get_valid_fee_recipient "${FEE_RECIPIENT}") | ||
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}") | ||
|
||
BEACON_API_4000="$(echo "$BEACON_API_URL" | cut -d':' -f1,2):4000" | ||
|
||
case "$NETWORK" in | ||
"holesky") | ||
NETWORK_FLAGS="--holesky" | ||
;; | ||
"lukso") | ||
NETWORK_FLAGS="--chain-config-file=${LUKSO_CONFIG_PATH}" | ||
;; | ||
"mainnet") | ||
NETWORK_FLAGS="--mainnet" | ||
;; | ||
"sepolia") | ||
NETWORK_FLAGS="--sepolia" | ||
;; | ||
*) | ||
echo "[ERROR - entrypoint] Unsupported network: $NETWORK" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "[INFO - entrypoint] Running validator service" | ||
|
||
# shellcheck disable=SC2086 | ||
exec /validator \ | ||
--datadir="${DATA_DIR}" \ | ||
--wallet-dir="${WALLET_DIR}" \ | ||
--monitoring-host 0.0.0.0 \ | ||
--beacon-rpc-provider="${BEACON_API_4000}" \ | ||
--beacon-rpc-gateway-provider="${BEACON_API_URL}" \ | ||
--validators-external-signer-url="${SIGNER_API_URL}" \ | ||
--grpc-gateway-host=0.0.0.0 \ | ||
--grpc-gateway-port="${VALIDATOR_API_PORT}" \ | ||
--grpc-gateway-corsdomain=http://0.0.0.0:"${VALIDATOR_API_PORT}" \ | ||
--graffiti="${VALID_GRAFFITI}" \ | ||
--suggested-fee-recipient="${VALID_FEE_RECIPIENT}" \ | ||
--verbosity="${VERBOSITY}" \ | ||
--web \ | ||
--accept-terms-of-use \ | ||
--enable-doppelganger ${NETWORK_FLAGS} ${MEVBOOST_FLAG} ${EXTRA_OPTS} |