Skip to content

Commit

Permalink
Remove migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Nov 11, 2024
1 parent c246cd8 commit ebc6172
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 324 deletions.
1 change: 0 additions & 1 deletion erigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ services:
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- NETWORK=${NETWORK}
- IPV6=${IPV6:-false}
- DOCKER_TAG=${ERIGON_DOCKER_TAG:-latest}
- COMPOSE_FILE=${COMPOSE_FILE}
- CL_P2P_PORT=${CL_P2P_PORT:-9000}
- CL_REST_PORT=${CL_REST_PORT:-5052}
Expand Down
88 changes: 26 additions & 62 deletions erigon/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,73 +54,37 @@ else
__network="--chain ${NETWORK} --http.api web3,eth,net,engine"
fi

if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Erigon archive node without pruning"
__prune="--prune.mode=archive"
else
echo "Erigon full node with pruning"
__prune="--prune.mode=full"
fi

__caplin=""
__db_params=""
# Literal match intended
# shellcheck disable=SC2076
if [[ "${DOCKER_TAG}" =~ "2." || "${DOCKER_TAG}" = "latest" ]]; then
# Check for network, and set prune accordingly
if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Erigon archive node without pruning"
__prune=""
else
if [[ "${NETWORK}" = "mainnet" ]]; then
echo "mainnet: Running with prune.r.before=11052984 for eth deposit contract"
__prune="--prune=htc --prune.r.before=11052984"
elif [[ "${NETWORK}" = "goerli" ]]; then
echo "goerli: Running with prune.r.before=4367322 for eth deposit contract"
__prune="--prune=htc --prune.r.before=4367322"
elif [[ "${NETWORK}" = "sepolia" ]]; then
echo "sepolia: Running with prune.r.before=1273020 for eth deposit contract"
__prune="--prune=htc --prune.r.before=1273020"
elif [[ "${NETWORK}" = "gnosis" ]]; then
echo "gnosis: Running with prune.r.before=19469077 for gno deposit contract"
__prune="--prune=htc --prune.r.before=19469077"
elif [[ "${NETWORK}" = "holesky" ]]; then
echo "holesky: Running without prune.r for eth deposit contract"
__prune="--prune=htc"
elif [[ "${NETWORK}" =~ ^https?:// ]]; then
echo "Custom testnet: Running without prune.r for eth deposit contract"
__prune="--prune=htc"
else
echo "Unable to determine eth deposit contract, running without prune.r"
__prune="--prune=htc"
fi
if [[ "${COMPOSE_FILE}" =~ (prysm\.yml|prysm-cl-only\.yml|lighthouse\.yml|lighthouse-cl-only\.yml|lodestar\.yml| \
lodestar-cl-only\.yml|nimbus\.yml|nimbus-cl-only\.yml|nimbus-allin1\.yml|teku\.yml|teku-cl-only\.yml| \
teku-allin1\.yml|grandine\.yml|grandine-cl-only\.yml|grandine-allin1\.yml) ]]; then
__caplin="--externalcl=true"
else
echo "Running Erigon with internal Caplin consensus layer client"
__caplin="--caplin.discovery.addr=0.0.0.0 --caplin.discovery.port=${CL_P2P_PORT} --caplin.backfilling.blob=true"
__caplin+=" --caplin.discovery.tcpport=${CL_P2P_PORT} --caplin.backfilling=true --caplin.validator-monitor=true"
__caplin+=" --beacon.api=beacon,builder,config,debug,events,node,validator,lighthouse"
__caplin+=" --beacon.api.addr=0.0.0.0 --beacon.api.port=${CL_REST_PORT} --beacon.api.cors.allow-origins=*"
if [ "${MEV_BOOST}" = "true" ]; then
__caplin+=" --caplin.mev-relay-url=${MEV_NODE}"
fi
__db_params="--db.pagesize 16K --db.size.limit 8TB"
else # Erigon v3
if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Erigon archive node without pruning"
__prune="--prune.mode=archive"
else
echo "Erigon full node with pruning"
__prune="--prune.mode=full"
__caplin+=" --caplin.archive=true"
fi
if [[ "${COMPOSE_FILE}" =~ (prysm\.yml|prysm-cl-only\.yml|lighthouse\.yml|lighthouse-cl-only\.yml|lodestar\.yml| \
lodestar-cl-only\.yml|nimbus\.yml|nimbus-cl-only\.yml|nimbus-allin1\.yml|teku\.yml|teku-cl-only\.yml| \
teku-allin1\.yml|grandine\.yml|grandine-cl-only\.yml|grandine-allin1\.yml) ]]; then
__caplin="--externalcl=true"
if [ -n "${RAPID_SYNC_URL}" ]; then
__caplin+=" --caplin.checkpoint-sync-url=${RAPID_SYNC_URL}"
else
echo "Running Erigon with internal Caplin consensus layer client"
__caplin="--caplin.discovery.addr=0.0.0.0 --caplin.discovery.port=${CL_P2P_PORT} --caplin.backfilling.blob=true"
__caplin+=" --caplin.discovery.tcpport=${CL_P2P_PORT} --caplin.backfilling=true --caplin.validator-monitor=true"
__caplin+=" --beacon.api=beacon,builder,config,debug,events,node,validator,lighthouse"
__caplin+=" --beacon.api.addr=0.0.0.0 --beacon.api.port=${CL_REST_PORT} --beacon.api.cors.allow-origins=*"
if [ "${MEV_BOOST}" = "true" ]; then
__caplin+=" --caplin.mev-relay-url=${MEV_NODE}"
echo "MEV Boost enabled"
fi
if [ "${ARCHIVE_NODE}" = "true" ]; then
__caplin+=" --caplin.archive=true"
fi
if [ -n "${RAPID_SYNC_URL}" ]; then
__caplin+=" --caplin.checkpoint-sync-url=${RAPID_SYNC_URL}"
echo "Checkpoint sync enabled"
else
__caplin+=" --caplin.checkpoint-sync.disable=true"
fi
echo "Caplin parameters: ${__caplin}"
__caplin+=" --caplin.checkpoint-sync.disable=true"
fi
echo "Caplin parameters: ${__caplin}"
fi

if [ "${IPV6}" = "true" ]; then
Expand All @@ -132,4 +96,4 @@ fi

# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${__ipv6} ${__network} ${__prune} ${__db_params} ${__caplin} ${EL_EXTRAS}
exec "$@" ${__ipv6} ${__network} ${__prune} ${__caplin} ${EL_EXTRAS}
Loading

0 comments on commit ebc6172

Please sign in to comment.