Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit edf8bbe

Browse files
authored
Indexer SDK introduction (#759)
* sdk documentation * fix links
1 parent e582226 commit edf8bbe

File tree

4 files changed

+1001
-12
lines changed

4 files changed

+1001
-12
lines changed

apps/nextra/pages/en/build/indexer/indexer-sdk/documentation.mdx

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
11
---
22
title: "Documentation"
33
---
4-
import { Callout } from 'nextra/components'
5-
import { IndexerBetaNotice } from '@components/index';
4+
import { ThemedImage } from '@components/index';
65

76
# Documentation
87

98
## Architecture of the Indexer SDK
109

11-
In the Aptos indexing stack, a processor indexes a specific subset of data from the blockchain and ingests the data into an external database.
10+
In the Aptos indexing stack, a processor indexes a specific subset of data from the blockchain and writes the data into an external database.
1211

1312
Each processor follows this general flow:
1413

15-
1. Receive a stream of Aptos transactions
16-
2. Extract the relevant data from the transactions
17-
3. Transform and merge the extracted data into a coherent, standardized schema
18-
4. Store the transformed data into a database
19-
20-
The Aptos Indexer SDK allows you to write and model each of your processor as a graph of independent `Step`'s'.
21-
Each `Step` has an input and an output, and the output of one `Step` is connected to the input of another `Step` by a channel.
22-
The flow above can be modeled as a graph of `Step`'s connected by channels.
23-
14+
1. Receive a stream of transactions from [Transaction Stream](../txn-stream.mdx)
15+
2. Extract the relevant data from the transactions and transform it into a standardized schema
16+
3. Store the transformed data into a database
17+
4. Keep track of the transaction versions that have been processed
18+
19+
The Indexer SDK allows you to write a processor as a directed graph of independent steps.
20+
Each `Step` has an input and output, and the output of each `Step` is connected to the input of the next `Step` by a [Kanal channel](https://github.com/fereidani/kanal).
21+
22+
<center>
23+
<ThemedImage
24+
alt="Indexer SDK Custom Processor Architecture"
25+
sources={{
26+
light: '/docs/indexer-custom-processor-light.svg',
27+
dark: '/docs/indexer-custom-processor-dark.svg',
28+
}}
29+
/>
30+
</center>
31+
32+
## When to use the Indexer SDK
33+
The Indexer SDK is useful when you want to index a custom contract or you realize you need a new kind of data that isn't available in the [Indexer API](../aptos-hosted.mdx).
34+
35+
The general flow to write a custom processor with the Indexer SDK is:
36+
1. Define your database schema
37+
2. Create a new processor
38+
3. Create `Step`s that extract and transform data into your storage schema
39+
2. Customize your processor by adding and connecting steps
40+
3. Run your processor and see the data indexed into your database
41+
42+
## Benefits of the Indexer SDK
2443
The Indexer SDK's architecture simplifies writing custom processors in several ways:
2544

2645
1. You can reuse `Step` implementations across processors which reduces duplication of common data extraction logic.

apps/nextra/public/docs/indexer-custom-processor-dark.svg

Lines changed: 3 additions & 0 deletions
Loading

apps/nextra/public/docs/indexer-custom-processor-light.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)