About Data and History
Mina is a succinct blockchain, and as a result, consensus nodes store only the recent history of the chain before discarding it (the last k blocks, currently 290). You can access recent history by using graphQL from a running mina daemon.
While prior transaction history is not required to prove the current state is valid (this is handled by using a recursive zero-knowledge proof), many applications need to access prior transaction history. Examples include block explorers and wallets.
You can optionally run an archive node to access historic data. The archive node process stores a summary of each block in a Postgres database. The archive node requires a running mina-archive daemon that connects to a running mina daemon and a PostgreSQL database.
An archive database on its own is not an integration surface — it has no API, and exposing Postgres to applications is not an option. Two services read that database and serve it over the network. Which one you want depends on what you are building.
In This Section
- Archive Node API - A GraphQL service over the archive database. Serves blocks, events, actions, and transactions, and is the path o1js and zkApps use to read history.
- Rosetta API - A standardized API for blockchain integration, exchange support, and historical data queries.
Both read the same archive database, and running both against one database is normal. Choose the Archive Node API for zkApp, explorer, and indexer work; choose Rosetta when you need the cross-chain interface exchanges already support.
For querying data from a running node via GraphQL, see Querying Data.