From 1b8d7a69fa100b7d5b57b886c71008e5466762b1 Mon Sep 17 00:00:00 2001 From: Konstantinos Demartinos Date: Fri, 24 Oct 2025 07:28:33 +0300 Subject: [PATCH] docs(custom-indexer): discuss dependency updates --- .../developer/advanced/custom-indexer.mdx | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/content/developer/advanced/custom-indexer.mdx b/docs/content/developer/advanced/custom-indexer.mdx index a1e9bdf83ce..7b3ccdf00b2 100644 --- a/docs/content/developer/advanced/custom-indexer.mdx +++ b/docs/content/developer/advanced/custom-indexer.mdx @@ -11,10 +11,34 @@ import Quiz from '@site/src/components/Quiz'; import questions from '/json/developer/advanced-topics/custom-indexer.json'; import CodeBlock from '@theme/CodeBlock'; -You can build custom indexers using the IOTA micro-data ingestion framework. To create an indexer, you subscribe to a checkpoint stream with full checkpoint content. This stream can be one of the publicly available streams from IOTA, one that you set up in your local environment, or a combination of the two. +You can build custom indexers using the IOTA data ingestion framework, which is maintained through the [iota-data-ingestion-core][] library. To create an indexer, you subscribe to a checkpoint stream with full checkpoint content. This stream can be one of the publicly available streams from IOTA, one that you set up in your local environment, or a combination of the two. Establishing a custom indexer helps improve latency, allows pruning the data of your IOTA full node, and provides efficient assemblage of checkpoint data. +## Setup + +To start, you need to specify the proper dependencies in your `Cargo.toml`. Here is what the minimal manifest would look like for a new indexer: + +```toml +[package] +name = "custom-indexer" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[dependencies] +iota-data-ingestion-core = { git = "https://github.com/iotaledger/iota", package = "iota-data-ingestion-core" } +iota-types = { git = "https://github.com/iotaledger/iota", package = "iota-types" } +``` + +:::caution + +When resolving `git` dependencies, Cargo records the latest commit hash at the time of the build on `Cargo.lock`. Updating to newer versions requires manually calling `cargo update iota-data-ingestion-core iota-types` and updating `Cargo.lock`. + +Network upgrades that introduce new types included in the checkpoint data will thus require updating custom indexers accordingly. + +::: + ## Interface and Data Format To use the framework, implement a basic interface: @@ -145,7 +169,7 @@ Specify both a local and remote store as a fallback to ensure constant data flow ### Manifest -Code for the cargo.toml manifest file for the custom indexer. +Code for the `Cargo.toml` manifest file for the custom indexer. ```toml file=/examples/custom-indexer/rust/Cargo.toml ``` @@ -154,4 +178,6 @@ Code for the cargo.toml manifest file for the custom indexer. Find the following source code in the [IOTA repo](https://github.com/iotaledger/iota/tree/main/examples/custom-indexer/rust). +[iota-data-ingestion-core]: https://github.com/iotaledger/iota/tree/develop/crates/iota-data-ingestion-core +