Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 2.27 KB

File metadata and controls

56 lines (38 loc) · 2.27 KB

NOTE: Generated by envio. Do not edit manually.

HyperIndex Indexer

Blockchain event indexer built with Envio HyperIndex. Processes on-chain events into a queryable GraphQL API backed by PostgreSQL.

Prerequisites

  • Node.js v22+ (v24 recommended), pnpm, Docker
  • ENVIO_API_TOKEN env var (required for HyperSync data source)

Commands

pnpm codegen          # Regenerate types from schema.graphql + config.yaml
pnpm tsc --noEmit     # Type-check without emitting
TUI_OFF=true pnpm dev # Run indexer (TUI_OFF for CI/AI-friendly output)
pnpm test             # Run tests (Vitest)

Workflow

  1. Edit schema.graphql and/or config.yaml
  2. Run pnpm codegen (required after any schema/config change)
  3. Edit handlers in src/handlers/
  4. Run pnpm tsc --noEmit to type-check
  5. Run TUI_OFF=true pnpm dev to verify at runtime

Key Rules

  • Spread operator for updates — Entities returned by context.Entity.get() are read-only. Always spread: context.Entity.set({ ...existing, field: newValue })
  • Effect API for external calls — All fetch, RPC, or other async I/O must use createEffect + context.effect(). Never call external services directly in handlers.
  • entity_id for relationships — Use token_id: String! not token: Token!. No entity arrays without @derivedFrom.
  • No @entity decorator — Unlike TheGraph, schema types have no decorators.
  • Codegen after schema/config changes — Generated types go stale otherwise. Always pnpm codegen first.

Config (config.yaml)

  • Uses chains (not networks), max_reorg_depth (not confirmed_block_threshold)
  • Handler field is optional — handlers auto-register from src/handlers/
  • Global contracts are auto-configured per chain
  • Validate with: # yaml-language-server: $schema=./node_modules/envio/evm.schema.json

Deep Documentation

Full LLM-optimized reference (schema, config, handlers, Effect API, testing): https://docs.envio.dev/docs/HyperIndex-LLM/hyperindex-complete

Skills

Detailed guides available in .claude/skills/ — auto-discovered by Cursor, Claude Code, and Codex.

Example Repos