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:
12
arc/arc-snapshot-init.Dockerfile
Normal file
12
arc/arc-snapshot-init.Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
# One-shot Arc snapshot downloader for compose init containers.
|
||||
# Wraps arc-snapshots with a shell entrypoint so operators can optionally
|
||||
# override EL/CL snapshot URLs via environment variables.
|
||||
ARG ARC_EXECUTION_IMAGE=docker.cloudsmith.io/circle/arc-network/arc-execution:0.7.2
|
||||
FROM ${ARC_EXECUTION_IMAGE} AS arc-bin
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libssl3 zlib1g \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=arc-bin /usr/local/bin/arc-snapshots /usr/local/bin/arc-snapshots
|
||||
COPY scripts/snapshot-init.sh /usr/local/bin/snapshot-init.sh
|
||||
RUN chmod +x /usr/local/bin/snapshot-init.sh
|
||||
ENTRYPOINT ["/usr/local/bin/snapshot-init.sh"]
|
||||
23
arc/scripts/snapshot-init.sh
Executable file
23
arc/scripts/snapshot-init.sh
Executable 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
|
||||
Reference in New Issue
Block a user