Skip to content
Merged
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
19 changes: 19 additions & 0 deletions shared/services/rocketpool/assets/install/scripts/start-ec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,25 @@ if [ "$CLIENT" = "reth" ]; then
echo -n "$(head -c 32 /dev/urandom | od -A n -t x1 | tr -d '[:space:]')" > /secrets/jwtsecret
fi

RETH_DATADIR="/ethclient/reth"

# Use official snapshots for mainnet when no db exists
if [ "$NETWORK" = "mainnet" ] && [ "$EC_PRUNING_MODE" = "rollingHistoryExpiry" ] && [ ! -f "$RETH_DATADIR/db/mdbx.dat" ]; then
echo "No Reth database found; downloading rolling-history snapshot"
if ! $PERF_PREFIX /usr/local/bin/reth download $RETH_NETWORK \
--datadir "$RETH_DATADIR" \
--with-txs-distance 2628000 \
--with-receipts-distance 2628000 \
--with-state-history-distance 10064 \
--with-rocksdb \
-y
then
echo "Reth snapshot download failed; removing partial data so the next start can retry"
rm -rf "$RETH_DATADIR/db" "$RETH_DATADIR/static_files" "$RETH_DATADIR/rocksdb" "$RETH_DATADIR/reth.toml"
exit 1
fi
fi

# Check for the prune flag and run that first if requested
if [ -f "/ethclient/prune.lock" ]; then
if [ "$EC_PRUNING_MODE" = "archive" ]; then
Expand Down
Loading