Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nethermind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
- AUTOPRUNE_NM=${AUTOPRUNE_NM:-true}
- NM_FLATDB=${NETHERMIND_FLATDB:-}
- NETWORK=${NETWORK}
- ERE_URL=${ERE_URL:-}
# For Grandine plugin
- COMPOSE_FILE=${COMPOSE_FILE}
- LOG_LEVEL=${LOG_LEVEL}
Expand Down
40 changes: 32 additions & 8 deletions nethermind/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,28 @@ case "${NODE_TYPE}" in
archive)
echo "Nethermind archive node without pruning"
__prune="--Sync.DownloadBodiesInFastSync=false --Sync.DownloadReceiptsInFastSync=false --Sync.FastSync=false --Sync.SnapSync=false --Sync.FastBlocks=false --Pruning.Mode=None --Sync.PivotNumber=0"
__ere_from=0
;;
full)
echo "Nethermind full node without history expiry"
__prune+=" --Sync.AncientBodiesBarrier=0 --Sync.AncientReceiptsBarrier=0"
__ere_from=0
;;
pre-merge-expiry)
case "${NETWORK}" in
mainnet)
echo "Nethermind minimal node with pre-merge history expiry"
__prune+=" --Sync.AncientBodiesBarrier=15537394 --Sync.AncientReceiptsBarrier=15537394 --History.Pruning=UseAncientBarriers"
__ere_from=15537394
;;
sepolia)
echo "Nethermind minimal node with pre-merge history expiry"
__prune+=" --Sync.AncientBodiesBarrier=1450408 --Sync.AncientReceiptsBarrier=1450408 --History.Pruning=UseAncientBarriers"
__ere_from=1450408
;;
*)
echo "There is no pre-merge history for ${NETWORK} network, \"pre-merge-expiry\" has no effect."
__ere_from=0
;;
esac
;;
Expand All @@ -152,17 +157,21 @@ case "${NODE_TYPE}" in
mainnet)
echo "Nethermind minimal node with pre-Prague history expiry"
__prune+=" --Sync.AncientBodiesBarrier=22431084 --Sync.AncientReceiptsBarrier=22431084 --History.Pruning=UseAncientBarriers"
__ere_from=22431084
;;
sepolia)
echo "Nethermind minimal node with pre-Prague history expiry"
__prune+=" --Sync.AncientBodiesBarrier=7836331 --Sync.AncientReceiptsBarrier=7836331 --History.Pruning=UseAncientBarriers"
__ere_from=7836331
;;
hoodi)
echo "Nethermind minimal node with pre-Prague history expiry"
__prune+=" --Sync.AncientBodiesBarrier=60412 --Sync.AncientReceiptsBarrier=60412 --History.Pruning=UseAncientBarriers"
__ere_from=60412
;;
*)
echo "There is no pre-Prague history for ${NETWORK} network, \"pre-prague-expiry\" has no effect."
__ere_from=0
;;
esac
;;
Expand All @@ -178,20 +187,35 @@ case "${NODE_TYPE}" in
;;
esac

echo "Using pruning parameters:"
echo "${__prune}"
if [[ -n "${__flat}" ]]; then
echo "Using FlatDB parameters:"
echo "${__flat}"
fi

# New or old datadir
if [[ -d /var/lib/nethermind-og/nethermind_db ]]; then
__datadir="--data-dir /var/lib/nethermind-og"
else
__datadir="--data-dir /var/lib/nethermind"
fi

# EraE import
__ere=""
if [[ -n "${ERE_URL}" && ! "${NETWORK}" =~ ^https?:// ]]; then # Named network
if [[ "${NODE_TYPE}" = "rolling-expiry" ]]; then
echo "Nethermind is configured for ${NODE_TYPE}, skipping EraE import."
else
__ere="--erae-importdirectory /var/lib/nethermind/ere --erae-remotebaseurl ${ERE_URL} --erae-from ${__ere_from}"
__prune=${__prune//--History.Pruning=UseAncientBarriers/} # Not compatible with EraE import
fi
fi

echo "Using pruning parameters:"
echo "${__prune}"
if [[ -n "${__ere}" ]]; then
echo "Using EraE import parameters:"
echo "${__ere}"
fi
if [[ -n "${__flat}" ]]; then
echo "Using FlatDB parameters:"
echo "${__flat}"
fi

if [[ "${COMPOSE_FILE}" =~ grandine-plugin(-allin1)?\.yml ]]; then
if [[ ! -f /var/lib/grandine/wallet-password.txt ]]; then
echo "Creating password for Grandine key wallet"
Expand Down Expand Up @@ -349,4 +373,4 @@ set -- "${__args[@]}"

# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${__datadir} ${__network} ${__prune} ${__flat} ${__grandine} ${EL_EXTRAS}
exec "$@" ${__datadir} ${__network} ${__prune} ${__ere} ${__flat} ${__grandine} ${EL_EXTRAS}
Loading