Indexer

Audience: Engineers working on packages/indexer or consuming Envio artifacts. Related docs: Monorepo Structure, packages/indexer/README.md Networks: Arbitrum One (42161), Celo (42220), Base Sepolia (84532). Deployment data: packages/contracts/deployments/*.json. Updated Novemberβ€―2024. External references: Review the Envio documentation when modifying handlers, and align GraphQL schemas with the official Envio guidance.

Blockchain event indexer exposing Green Goods data via GraphQL.


Quick Reference

Path: packages/indexer/ Port: http://localhost:8080 Password: testing (local) Stack: Envio HyperIndex + PostgreSQL

Commands:

bun --filter indexer dev     # Start indexer (checks Docker)
bun --filter indexer stop    # Stop indexer
bun --filter indexer reset   # Reset completely
bun --filter indexer codegen # Regenerate after schema changes

What It Indexes

Events:

  • Garden creation (GardenCreated)

  • Action registration (ActionRegistered)

  • Work submissions (via EAS attestations)

  • Work approvals (via EAS attestations)

  • Member changes (GardenerAdded, OperatorAdded)

Entities:

  • Gardens

  • Actions

  • Work

  • WorkApproval

  • Attestations


GraphQL API

Public Endpoint: https://indexer.hyperindex.xyz/0bf0e0f/v1/graphql

Query Example:

Subscription Example:


Architecture

Files:

  • config.yaml: Networks and contracts

  • schema.graphql: Entity definitions

  • src/EventHandlers.ts: Event processing logic

  • abis/: Contract ABIs


Development

Schema Changes:

  1. Edit schema.graphql

  2. Run bun codegen

  3. Run bun run setup-generated

  4. Restart: bun dev

Docker Management:


Conventions

Entity IDs

Composite format: chainId-identifier

Always Include chainId


Complete Documentation

πŸ“– Full details: packages/indexer/README.md

Key Files:

  • Envio conventions: .cursor/rules/envio-conventions.mdc

  • Development workflow: .cursor/rules/indexer-workflow.mdc

Last updated