A high-performance indexing layer with a queryable GraphQL API over Ledger Chain on-chain data. It enables efficient data access for dashboards, applications, and analytics tools without directly querying the blockchain.
This project provides a Subsquid-based indexer that consumes raw blockchain events from Ledger Chain, transforms them into a structured schema, and exposes them through a GraphQL endpoint. It replaces direct chain queries with a fast, developer-friendly API suitable for front-end applications and data analytics.
- Indexer — Docker Compose setup for the Squid indexer that ingests on-chain events
- Processor — Event processing pipeline that maps raw chain data to database models
- GraphQL schema —
schema.graphqldefining the queryable data model - Database migrations — Migration files for the processor database
- Type definitions — Chain-specific type files for decoding events
- Mapping functions — Logic for transforming events into indexed entities
- Scripts — Utility scripts for generating initial state and development workflows
The indexer sits between the blockchain and consumer applications. It decouples data access from the chain, allowing complex queries, aggregations, and historical lookups that would be inefficient or impossible via direct RPC calls. Dashboards, explorers, and third-party integrations rely on this layer for real-time and historical data.
The data pipeline is:
Ledger Chain => Squid Indexer => Indexer GraphQL gateway => Squid Processor => Database => Query Node GraphQL endpoint
This technology is used within the ThreeFold ecosystem and was first deployed on the ThreeFold Grid. The component itself is designed as reusable infrastructure technology and should be understood by its technical function first, independent of any specific deployment.
This repository is owned and maintained by TF-Tech NV, a Belgian company responsible for the development and maintenance of this technology.
- Node v20+
- Docker
- Docker Compose
See docs for detailed running instructions.
indexer/— Docker Compose setup for the indexer (archive)db/— Processor database migration filesscripts/— Utility scripts (see scripts/readme.md)src/— Processor source codemappings/— Event handler functions that map chain events to database entitiesmodel/— Generated TypeORM models fromschema.graphqltypes/— Auto-generated type definitions (do not edit manually — runmake typegen)processor.ts— Processor entrypoint: event subscription and dispatch
typegen/— Type generation infrastructuretfchainVersions.jsonl— Append-only log of runtime metadata from all Ledger Chain networkstypegen.json— Typegen config: which events to generate types fortypesBundle.json— Frozen pre-V14 type mappings (do not edit for new runtime versions)
docs/— Documentation- typeChanges.md — How to handle type changes on chain (adding new runtime versions, resync guidance)
- development.md — Local development setup
- production.md — Production deployment
- release_process.md — Release workflow
schema.graphql— GraphQL schema — changes here regeneratesrc/model/vianpm run codegenMakefile— Common tasks:typegen,typegen-add,typegen-seed,version-bumpprocessor-chart/— Helm chart for processor + query node deploymentindexer/chart/— Helm chart for indexer stack deployment
This project is licensed under the Apache License 2.0 — see the LICENSE file for details.