arc: add snapshot-init wrapper for testnet pruned bootstrap

Shell entrypoint wraps arc-snapshots so compose can optionally override EL/CL
snapshot URLs via ARC_SNAPSHOT_* env vars while defaulting to latest from
snapshots.arc.network on fresh volumes.
This commit is contained in:
2026-07-04 05:51:19 +00:00
parent 921fec2e86
commit defc60469b
2 changed files with 35 additions and 0 deletions

23
arc/scripts/snapshot-init.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
CHAIN="${ARC_SNAPSHOT_CHAIN:-arc-testnet}"
EXEC_PATH="${ARC_SNAPSHOT_EXECUTION_PATH:-/data/execution}"
CONS_PATH="${ARC_SNAPSHOT_CONSENSUS_PATH:-/data/consensus}"
if [ -n "${ARC_SNAPSHOT_EXECUTION_URL:-}" ] && [ -n "${ARC_SNAPSHOT_CONSENSUS_URL:-}" ]; then
exec /usr/local/bin/arc-snapshots download \
--chain="${CHAIN}" \
--execution-path="${EXEC_PATH}" \
--consensus-path="${CONS_PATH}" \
--execution-url="${ARC_SNAPSHOT_EXECUTION_URL}" \
--consensus-url="${ARC_SNAPSHOT_CONSENSUS_URL}"
elif [ -n "${ARC_SNAPSHOT_EXECUTION_URL:-}" ] || [ -n "${ARC_SNAPSHOT_CONSENSUS_URL:-}" ]; then
echo "Both ARC_SNAPSHOT_EXECUTION_URL and ARC_SNAPSHOT_CONSENSUS_URL must be set together" >&2
exit 1
else
exec /usr/local/bin/arc-snapshots download \
--chain="${CHAIN}" \
--execution-path="${EXEC_PATH}" \
--consensus-path="${CONS_PATH}"
fi