Skip to main content
Use this section when you need historical or stateful chain data in a Postgres-backed shape instead of one-off RPC reads.

Use This When

  • you need a backend to keep a SQL view of on-chain events or account state
  • you want to expose indexed chain data through app APIs
  • you need filtering, joins, and pagination over chain data that would be awkward to do directly from RPC

Core Packages

PackageRole
@thru/indexerDefines streams, manages checkpoints, writes rows to Postgres, and can mount generated API routes.
@thru/replaySupplies the historical-plus-live replay layer and the ChainClient used by the indexer runtime.

The Shape Of A Thru Indexer

Most projects follow this pattern:
  1. define one or more event or account streams
  2. export the resulting stream tables in the Drizzle schema
  3. construct new Indexer(...) with a DB client, ChainClient factory, and stream arrays
  4. optionally mount generated routes for those streams in a Hono app

Start Here

Quickstart

Build the smallest working token indexer with one event stream and one account stream.

Streams

Learn how event streams and account streams differ, and how to write each safely.

Running the Indexer

See the runtime architecture, tech-stack assumptions, and the indexer boot flow.

Querying Indexed Data

Query stream tables directly or expose them through generated routes.

Next Steps

  1. Read Quickstart for the first successful end-to-end setup.
  2. Move to Streams when you need to add or customize event or account parsing.
  3. Use Running the Indexer when you are wiring runtime config, checkpoints, migrations, or deployment shape.
  4. Use Querying Indexed Data once data is landing in Postgres.