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 v16.x
- Docker
- Docker Compose
See docs for detailed running instructions.
indexer— Docker Compose setup for the indexerdb— Processor database migration filesscripts— Scripts for generating initial state and development scriptssrc— Source codemappings— Mapper functions for indexer datamodel— Generated models from theschema.graphqlfiletypes— Type files that require manual edits when the schema or chain types changeprocessor.ts— Processor entrypoint
typegen— Declaration file generation (used for development)tfchainVersions.jsonl— Generated Ledger Chain runtime versions and their datatypegen.json— Typegen configtypesBundle.json— Typegen bundle config
schema.graphql— The GraphQL schema file; changes to this file result in changes to the models insrc/models
This project is licensed under the Apache License 2.0 — see the LICENSE file for details.