Skip to content

Commit 358881f

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-standardize-npm
# Conflicts: # README.md
2 parents 1e38c20 + ad05902 commit 358881f

2 files changed

Lines changed: 81 additions & 58 deletions

File tree

LICENSE

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1-
Apache License
2-
Version 2.0, January 2004
3-
http://www.apache.org/licenses/
1+
The software contained in this repository and all rights, title, and interest
2+
3+
Copyright © TF TECH NV
4+
Belgian Enterprise Number: BE 0712.845.674
5+
6+
Authored and maintained by TF TECH NV.
7+
8+
TF TECH NV retains ownership of its contributions to this software.
9+
10+
11+
This software is Licensed under the Apache License, Version 2.0 (the "License");
12+
you may not use this file except in compliance with the License.
13+
You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing, software
18+
distributed under the License is distributed on an "AS IS" BASIS,
19+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
See the License for the specific language governing permissions and
21+
limitations under the License.
22+
423

524
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
625

@@ -175,27 +194,3 @@
175194

176195
END OF TERMS AND CONDITIONS
177196

178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright TF TECH NV (Belgium)
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

README.md

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,73 @@
1-
# TFChain GraphQL
1+
# Ledger GraphQL
22

3-
[Subsquid](https://docs.subsquid.io) is used to index and provide a GraphQL interface on top of TFChain.
3+
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.
44

5-
## Concept
5+
## What this is
66

7-
The substrate events are processed in a multi-step pipeline:
7+
This project provides a [Subsquid](https://docs.subsquid.io)-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.
88

9-
TFChain => Squid Indexer => Indexer GraphQL gateway => Squid Processor => Database => Query Node GraphQL endpoint
9+
## What this repository contains
1010

11-
![Bird eye overview](https://gblobscdn.gitbook.com/assets%2F-MdI-MAyz-csivC8mmdb%2Fsync%2Fe587479ff22ad79886861487b2734b6556302d10.png?alt=media)
11+
- **Indexer** — Docker Compose setup for the Squid indexer that ingests on-chain events
12+
- **Processor** — Event processing pipeline that maps raw chain data to database models
13+
- **GraphQL schema**`schema.graphql` defining the queryable data model
14+
- **Database migrations** — Migration files for the processor database
15+
- **Type definitions** — Chain-specific type files for decoding events
16+
- **Mapping functions** — Logic for transforming events into indexed entities
17+
- **Scripts** — Utility scripts for generating initial state and development workflows
18+
19+
## Role in the stack
20+
21+
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.
22+
23+
The data pipeline is:
24+
25+
```
26+
Ledger Chain => Squid Indexer => Indexer GraphQL gateway => Squid Processor => Database => Query Node GraphQL endpoint
27+
```
28+
29+
## Relation to ThreeFold
30+
31+
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.
32+
33+
## Ownership
34+
35+
This repository is owned and maintained by TF-Tech NV, a Belgian company responsible for the development and maintenance of this technology.
1236

1337
## Prerequisites
1438

15-
* Node v20+
16-
* Docker
17-
* Docker Compose
39+
- Node v20+
40+
- Docker
41+
- Docker Compose
1842

1943
## Running
2044

21-
See [docs](./docs/readme.md)
45+
See [docs](./docs/readme.md) for detailed running instructions.
2246

2347
## Project layout
2448

25-
- `indexer/` - Docker Compose setup for the indexer (archive)
26-
- `db/` - Processor database migration files
27-
- `scripts/` - Utility scripts (see [scripts/readme.md](./scripts/readme.md))
28-
- `src/` - Processor source code
29-
- `mappings/` - Event handler functions that map chain events to database entities
30-
- `model/` - Generated TypeORM models from `schema.graphql`
31-
- `types/` - Auto-generated type definitions (do not edit manually — run `make typegen`)
32-
- `processor.ts` - Processor entrypoint: event subscription and dispatch
33-
- `typegen/` - Type generation infrastructure
34-
- `tfchainVersions.jsonl` - Append-only log of runtime metadata from all TFChain networks
35-
- `typegen.json` - Typegen config: which events to generate types for
36-
- `typesBundle.json` - Frozen pre-V14 type mappings (do not edit for new runtime versions)
37-
- `docs/` - Documentation
38-
- [typeChanges.md](./docs/typeChanges.md) - How to handle type changes on chain (adding new runtime versions, resync guidance)
39-
- [development.md](./docs/development.md) - Local development setup
40-
- [production.md](./docs/production.md) - Production deployment
41-
- [release_process.md](./docs/release_process.md) - Release workflow
42-
- `schema.graphql` - GraphQL schema — changes here regenerate `src/model/` via `npm run codegen`
43-
- `Makefile` - Common tasks: `typegen`, `typegen-add`, `typegen-seed`, `version-bump`
44-
- `processor-chart/` - Helm chart for processor + query node deployment
45-
- `indexer/chart/` - Helm chart for indexer stack deployment
49+
- `indexer/` — Docker Compose setup for the indexer (archive)
50+
- `db/` — Processor database migration files
51+
- `scripts/` — Utility scripts (see [scripts/readme.md](./scripts/readme.md))
52+
- `src/` — Processor source code
53+
- `mappings/` — Event handler functions that map chain events to database entities
54+
- `model/` — Generated TypeORM models from `schema.graphql`
55+
- `types/` — Auto-generated type definitions (do not edit manually — run `make typegen`)
56+
- `processor.ts` — Processor entrypoint: event subscription and dispatch
57+
- `typegen/` — Type generation infrastructure
58+
- `tfchainVersions.jsonl` — Append-only log of runtime metadata from all Ledger Chain networks
59+
- `typegen.json` — Typegen config: which events to generate types for
60+
- `typesBundle.json` — Frozen pre-V14 type mappings (do not edit for new runtime versions)
61+
- `docs/` — Documentation
62+
- [typeChanges.md](./docs/typeChanges.md) — How to handle type changes on chain (adding new runtime versions, resync guidance)
63+
- [development.md](./docs/development.md) — Local development setup
64+
- [production.md](./docs/production.md) — Production deployment
65+
- [release_process.md](./docs/release_process.md) — Release workflow
66+
- `schema.graphql` — GraphQL schema — changes here regenerate `src/model/` via `npm run codegen`
67+
- `Makefile` — Common tasks: `typegen`, `typegen-add`, `typegen-seed`, `version-bump`
68+
- `processor-chart/` — Helm chart for processor + query node deployment
69+
- `indexer/chart/` — Helm chart for indexer stack deployment
70+
71+
## License
72+
73+
This project is licensed under the Apache License 2.0 — see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)