Skip to content

docs: add an Archive Node API integration guide - #1222

Open
dkijania wants to merge 1 commit into
mainfrom
docs/archive-node-api
Open

docs: add an Archive Node API integration guide#1222
dkijania wants to merge 1 commit into
mainfrom
docs/archive-node-api

Conversation

@dkijania

@dkijania dkijania commented Sep 2, 2026

Copy link
Copy Markdown
Member

What & why

The Archive Node API is how o1js, zkApps, explorers and indexers read Mina's history, and it has no page on the docs site. Today it appears only in passing from three zkApp pages — none of which says how to run it, what it serves, or how to reach it from a language other than TypeScript. Anyone integrating has to read the repository.

This adds it to Data and History, beside Rosetta. That section already exists to answer "how do I get Mina's history over a network", and until now it answered with Rosetta alone. Both services read the same archive database; the pair is the complete answer, so the section index now routes between them rather than listing one.

The page

Organized around what an integrator decides, in the order they decide it:

  1. Choose a data path — daemon GraphQL vs Archive Node API vs Rosetta vs raw Postgres, with the reason each exists. The daemon keeps only the last k blocks; that is why this service exists at all.
  2. Architecture — which of the four processes does what, and on which port.
  3. Quick start — npm, prebuilt Docker image, or Compose with a database snapshot, in tabs, plus a curl that proves it is serving.
  4. The query surface — the five root fields, with worked events and actions examples. The actions example folds from a checkpoint, which is the o1js reducer path.
  5. Using it from o1js — the archive property, linking through to the existing Fetch Events and Actions page.
  6. Client SDKs — TypeScript, Rust and Go, one tab each.
  7. Configuration — split into essentials, database, and exposure controls.
  8. Running it in production — the probe and metrics endpoints, and the drain behaviour on SIGTERM.
  9. Schema stability — what a minor and a major schema release mean.

Two defaults get :::caution callouts because both fail quietly rather than loudly:

  • The rate limiter stays disabled until TRUST_PROXY is set, because neither socket-keying nor blind X-Forwarded-For trust is safe to assume.
  • A browser front end cannot call the API until its origin is in CORS_ORIGIN.

Accuracy

Every code sample was checked against the source rather than written from memory: the Rust builder chain (EventFilterOptionsInput::for_address(..).status(..)), the Go package name and option functions (archive.NewClient(archive.WithGraphQLURI(..))), the TypeScript constructor, the ghcr.io/o1-labs/archive-node-api image path, and the download_db.sh Compose flow. Defaults in the configuration tables come from the repository's setup guide. The install snippets deliberately pin no versions, so they stay correct across releases.

Testing

  • npm run build — succeeds. onBrokenLinks is throw, so every internal link on the new page resolves; the page renders to build/node-operators/data-and-history/archive-node-api.html.
  • The one build warning is pre-existing and unrelated: four broken anchors into /network-upgrades/mesa/glossary.
  • static/llms-full.txt and static/llms.txt regenerated, as the Check llms-full.txt is up to date workflow requires. The diff is additive — the new page only.

🤖 Generated with Claude Code

https://claude.ai/code/session_012LtdRKTkaKRAuTkEEpgPcc

The Archive Node API is how o1js, zkApps, explorers and indexers read
Mina's history, and it had no page here. It was mentioned only in
passing from three zkApp pages, none of which say how to run it, what it
serves, or how to reach it from a language other than TypeScript.

Adds it to Data and History, next to Rosetta: both read the same archive
database, and the pair is the whole answer to "how do I get Mina's
history over a network". The section index now routes between them
instead of listing Rosetta alone.

The page is organized around what an integrator decides, in order: which
data path fits the job, how to stand the service up, what the five root
fields return, how o1js reaches it, the client SDKs for TypeScript, Rust
and Go, and what to set before exposing it.

Two configuration defaults get their own callouts because both fail
quietly: the rate limiter stays disabled until TRUST_PROXY is set, and a
browser front end cannot call the API until its origin is allowlisted in
CORS_ORIGIN.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012LtdRKTkaKRAuTkEEpgPcc
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs2 Ready Ready Preview Sep 2, 2026 9:44pm UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant