Mina provisioning tool: restores archive DB dumps and fetches blocks, ledgers and daemon configs
104
Fetches, verifies and places the published artifacts a Mina node needs before it can start: archive database dumps, precomputed blocks and runtime configuration files.
archive: downloads the newest published archive dump and loads it into
PostgreSQL. It leaves an existing archive alone with --if-present=skip.blocks: downloads precomputed blocks for a height range.daemon-config: the configuration file a daemon loads at start.genesis-config: the fork configuration a chain starts from.replayer-input: rewrites a fork configuration into the input file the
replayer reads.A file is placed only when it is complete. When the publisher provides a
digest, it is checked first: the daemon-config packages are checked against
the apt repository index.
Source, documentation and issues: https://github.com/MinaProtocol/mina-provision
| Tag | What it is |
|---|---|
<version>, for example 0.0.6 | a release. Pin this in production |
latest | the newest release |
The images are built for linux/amd64 and linux/arm64. The same images, with
the same digests, are on ghcr.io/minaprotocol/mina-provision.
Restore the archive database from the newest published dump. Here
PostgreSQL runs in a container named postgres on the Docker network mina:
docker run --rm --network mina \
-e PGPASSWORD="$POSTGRES_PASSWORD" \
minaprotocol/mina-provision:0.0.6 \
archive --network mainnet --if-present=skip \
--pg-uri postgres://postgres@postgres:5432/archive
--hour, the newest hourly dump of the day is used, so the archive
starts close to the chain tip.--if-present=skip, a database that already holds an archive is left
alone, and nothing is downloaded. This makes the command safe to run on every
start, for example as an init container.PGPASSWORD, not in --pg-uri. Then it is not visible
in the process list.Fetch the daemon configuration into a directory on the host:
mkdir -p out
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD/out:/out" \
minaprotocol/mina-provision:0.0.6 \
daemon-config --network mainnet --out /out
Fetch precomputed blocks. The bucket has mainnet blocks from about height 293000 on, the chain since the Berkeley upgrade:
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD/blocks:/blocks" \
minaprotocol/mina-provision:0.0.6 \
blocks --network mainnet --range 500000-500100 --out /blocks
For a full deployment, see the docker-compose recipes for the archive node and
Rosetta in the Mina repository: src/app/archive/docker-compose and
src/app/rosetta/docker-compose.
| Variable | Same as |
|---|---|
MINA_NETWORK | --network (mainnet or devnet) |
MINA_PROVIDER | --provider |
MINA_PROVISION_CONFIG | --provider-config, a file that points the tool at a mir |
A flag on the command line wins over the environment.
10001. Its working directory is
/work, which any user can write to. Add --user "$(id -u):$(id -g)" so
that files written to a mounted directory belong to you.archive downloads and extracts the dump into --work-dir
(default: /work in the container). A mainnet dump needs several GB. Mount a
volume there, or pass --work-dir to a mounted path, if the container's own
disk is small.postgresql-client, version 15.14 or later), so
archive needs nothing else.docker buildx imagetools inspect minaprotocol/mina-provision:<version>.Content type
Image
Digest
sha256:9af04eb06…
Size
57.8 MB
Last updated
3 days ago
docker pull minaprotocol/mina-provision