Skip to main content

Architecture

Version: V2
View Markdown

A successful receipt containing MultiVault’s AtomCreated log records the creation of an atom on that chain. To read that atom from your own Core node, the node must first index the event and project it into its knowledge graph. You can also create an atom directly in that local graph.

How it works​

Follow one atom from the chain​

Suppose MultiVault emits AtomCreated for the UTF-8 bytes of hello. Those bytes are also written as 0x68656c6c6f. Both representations produce the atom ID 0xa0e157e5fa1b17d3b54ec73622ce3317296920a06502661617613d59f58e947e. A triple has its own ID derived from three term IDs in subject, predicate, object order. This lets a reader start with the same data and find the same term across stores. ID derivation · Known-answer tests

  1. Ingest the log. With the indexing profile enabled for that chain and MultiVault, the Rust indexer decodes the log. It writes the event to TimescaleDB’s event_store and its typed atom_created_events table in one transaction. The two rows share a sequence number. The transaction hash and log index let you trace the specific emission. Ingestion storage · Event store migration
  2. Project it into the graph. The core_entities projection reads from its saved checkpoint. It writes the term to TimescaleDB, then writes the atom to kg.nodes in a separate Postgres database. An indexed triple goes into kg.triples. Other projections maintain market read models such as vaults and positions in TimescaleDB, with their own checkpoints. Each checkpoint records progress for a projection and its destination, so a restart can replay a batch. Projection writes · Checkpoint handling
  3. Process and read the node. A newly indexed public atom starts with pending worker stages. Parsing interprets its input, classification assigns a type, and enrichment can attach provider artifacts. The Query API serves the public graph from Postgres. You can use GET /api/atoms/{id} while enrichment is still pending. For triples, Postgres keeps six indexes, one for every ordering of subject, predicate and object. A predicate-first lookup can use its own index even though the triple ID always uses subject first. The adjacency table also indexes relationships by source and neighbor. Data model · Graph schema and indexes

Start with the local graph​

Send {"input":"hello"} to POST /api/atoms with write access. A new local atom returns HTTP 201 and the same ID as above. Sending the same input again returns HTTP 200 with created: false. This path writes to the KG and queues the same processing stages without submitting a chain transaction. If an on-chain creation arrives later, the projection skips the existing node on ID conflict. Its isOnchain field can remain false even after the event was indexed. Use the receipt and corresponding event-store row to trace the chain creation. Creation handler · Node persistence · Projection conflict handling

Locate a delay​

The default stack serves the local graph. Chain ingestion and projections require the indexing profile, and Explorer runs separately as an API client. Run one ingester for the configured scope. Compose supplies REDIS_URL. The shared Rust configuration defines REDIS_LEADER_KEY and REDIS_LEADER_TTL_SEC. Stock Compose does not forward these two settings, and the ingester starts without acquiring a Redis leader lock. Redis configuration Compose profiles · Ingestion entrypoint · Indexer startup

What you can seeWhat to check next
A successful receipt, but no matching eventCheck that the indexer follows the receipt’s chain and MultiVault address, and that its block range includes the receipt block. Compare the block hash with the canonical chain if a reorganization is possible.
A matching event, but no public atomCompare the event sequence with the core entities projection’s checkpoint. Read the KG on the same node by term ID. Market projection progress is independent.
A public atom with incomplete processingInspect the stage, attempts and lease expiry. An expired lease allows another worker to claim unfinished work while attempts remain. After the cap, an expired claim can become a terminal failure. Use the recorded stage error to diagnose it.

Architecture overview · Checkpoint schema · Worker lease recovery