Skip to main content

Indexing and querying

Version: V2
View Markdown

Indexing makes chain events available to readers of a Core node you run. Its indexer records events, projections turn them into graph records, and workers can parse, classify, and enrich the atoms. V2 applications read the resulting graph through that node’s Query API. A receipt can arrive before the node has ingested and projected the corresponding atom event.

Builds on: Protocol writes, Atom runtime and pipelines.

Implemented by: Intuition Core.

How it works​

Fork and clone Intuition Core and build the pinned source. The default Compose stack serves the off-chain graph. To ingest chain events, configure the chain RPC, chain ID, MultiVault address and start block, then enable the indexing profile. That profile runs ingestion and projections. Source setup, Compose services.

The indexer decodes events into the TimescaleDB event store. Projections record their progress in checkpoints as they populate read models and copy atoms and triples into the Postgres knowledge graph. Workers claim atom processing stages and persist outcomes there. The API reads from the knowledge graph, so an atom can be visible while enrichment is pending or has failed. Architecture, data model.

The node also accepts off-chain inserts. Under its default public-read policy, a writable key authorizes POST /api/atoms with an input string. A successful insert creates a node-local record. Registering the same bytes on-chain requires a separate protocol write and indexing its event. Query API contract.

There is no V2 GraphQL endpoint yet; one is planned for Intuition Core. The V1 GraphQL API is documented in the V1 docs.

Example​

A catalog derives an atom ID for its chosen recording bytes. Keep that ID throughout the following checks.

ObservationWhat the catalog knows
A wallet returns a transaction hashIt can track the submitted transaction on the chosen chain.
A successful receipt for the creation includes the atom eventThe write executed. The catalog's node might still be behind that block.
GET /api/atoms/{id} returns the atomThe node can serve that record. Inspect isOnchain to distinguish an indexed chain record from an off-chain insert.
The atom has processing statusesRead parseStatus, classificationStatus, and enrichmentStatus separately. Inspect available artifacts at GET /api/atoms/{id}/artifacts before displaying provider evidence.

If the receipt is successful and the atom is absent, check the node's chain, MultiVault address, block range, and projection progress. Repeating the chain write would address none of these causes. Query a Core node.

Common mistakes​

  • Assuming an off-chain insert will publish itself. The API response records what happened on that node. A chain submission requires separate authorization.
  • Expecting semantic fields after enabling one flag. API_ATOM_SEMANTIC_READS_ENABLED, WORKERS_IID_READ_ENABLED, and WORKERS_IID_RESOLUTION_ENABLED each default to false. The API setting controls presentation. The worker settings control IID reads and provider resolution. Use the documented response fields and inspect the actual processing state. Configuration, worker defaults.
  • Using a seeded predicate's label to prepare a protocol triple. Verify the canonical predicate data and ID before constructing the triple. Predicate registry.

Next​

Query a Core node walks through building the source, selecting the indexing profile, and reading your own graph.