Skip to content

Commit

Permalink
Handle archive/pruning and PBSS
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Aug 4, 2023
1 parent 063860b commit e523be0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions geth/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ fi
if [ -d "/var/lib/goethereum/geth/chaindata/" ]; then
__pbss=""
else
echo "Choosing PBSS for fresh sync"
__pbss="--state.scheme path"
if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Geth is an archive node. Syncing without PBSS."
_pbss=""
else
echo "Choosing PBSS for fresh sync"
__pbss="--state.scheme path"
touch /var/lib/goethereum/is-pbss
fi
fi

if [ -f /var/lib/goethereum/prune-marker ]; then
Expand All @@ -70,6 +76,10 @@ if [ -f /var/lib/goethereum/prune-marker ]; then
echo "Geth is an archive node. Not attempting to prune: Aborting."
exit 1
fi
if [ -f /var/lib/goethereum/is-pbss ]; then
echo "Geth is using PBSS. Pruning is neither needed nor supported. Aborting."
exit 1
fi
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${EL_EXTRAS} snapshot prune-state
Expand Down

0 comments on commit e523be0

Please sign in to comment.