Skip to content

Custom indexer tutorial contains compilation errors in example code #24255

@Ashwin-3cS

Description

@Ashwin-3cS

Steps to Reproduce Issue

Following the "Build Your First Custom Indexer" tutorial at docs/content/guides/developer/advanced/custom-indexer.mdx results in compilation errors.

  1. Follow all steps in the tutorial exactly as written
  2. Run cargo build after completing Step 10
  3. Observe three compilation errors

Expected Result

The tutorial code should compile successfully and the indexer should run without errors.

Actual Result

Compilation fails with three errors:

error[E0412]: cannot find trait `Store` in this scope
  --> src/handlers.rs:56:35

error[E0308]: mismatched types (commit method signature)
  --> src/handlers.rs:50:9

error[E0277]: `impl Future<Output = Result<Vec<StoredTransactionDigest>>>` cannot be sent between threads safely
  --> src/handlers.rs:24:5

System Information

  • OS: All platforms affected
  • Compiler: rustc 1.74.0+ (any recent version)
  • Tutorial location: docs/content/guides/developer/advanced/custom-indexer.mdx

Root Cause

The example code is outdated and missing:

  1. store::Store import
  2. Correct type signature for commit method
  3. #[async_trait::async_trait] attribute

Note

This is a documentation/tutorial issue. The example code needs updating to match current API requirements.

Proposed Fix

The examples/rust/basic-sui-indexer/src/handlers.rs file needs three changes:

  1. Add missing import: use sui_indexer_alt_framework::store::Store;
  2. Fix commit method signature: conn: &mut <Self::Store as Store>::Connection<'a>
  3. Add attribute: #[async_trait::async_trait] to the Processor implementation

I have tested these changes and confirmed they resolve all compilation errors. The indexer successfully compiles and runs against Testnet after applying these fixes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions