Preview. Stack v4.0 has not been released, and what is documented here can still change before it does. The current release is v3.2, which covers this as Working with the Ledger.Go to v3.2
Ledger

Read and Query Data

Start from the smallest read that answers the question, then add filters, indexes, and consistency controls only when one is required.

Ledger stores accounts, transactions, logs, and an audit trail, and exposes a read API over each. This section covers retrieving those records, narrowing and paging results, controlling how fresh a read is, and the opt-in indexes and stored queries that some reads need.

Read an account or transaction directly when you know its identity. Add another query feature only when the read needs it.

Choose only what the read needs#

NeedStart withAdd when required
One known account or transactionDirect lookup by full address or transaction IDNothing else; direct lookups do not require an opt-in index
A subset of recordsA target-specific filterThe index required by each filter condition
More rows than one responsePaginationKeep the filter, order, and page size unchanged between pages
A read that must include a completed writeThe write's returned log sequenceA minimum-log-sequence wait on supported gRPC reads, or the prepared-query freshness gate
Several reads of one fixed stateA query checkpointThe same checkpoint ID on every read and every page
One reviewed query shared by several callersA prepared queryRuntime parameters for values that change per request
A description of existing data patternsAnalysisA planned capacity window, or a write pause when the result must be reproducible

Readiness and v3.0 limits

An index-dependent query is ready only after every replica that can serve the read reports a usable local version. Creating the index starts that work; it does not complete it.

In Ledger v3.0, prepared queries accept minLogSequence but not a query checkpoint. Use direct gRPC reads when several queries or pages must share one frozen checkpoint.

Query results describe stored data, but they do not verify its integrity. Use Verify Ledger Integrity when you need an integrity assessment.