indexer-configuration

Configures HyperIndex config.yaml files with chains, contracts, events, and environment variables.

546|55|Updated May 24, 2024
One-click install
npx skills add https://github.com/enviodev/hyperindex --skill indexer-configuration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: indexer-configuration
Source: https://github.com/enviodev/hyperindex/tree/main/packages/cli/templates/static/shared/.claude/skills/indexer-configuration
Command: npx skills add https://github.com/enviodev/hyperindex --skill indexer-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing a valid HyperIndex config.yaml requires knowing the exact schema for chains, contracts, event signatures, start blocks, and environment variables, and mistakes like using deprecated options or wrong address formats silently break indexing.

Core Features & Use Cases

  • Chain and Contract Structure: Defines chains with IDs, start blocks, and contract entries supporting single addresses, multiple addresses, or wildcard indexing.
  • Event Selection and Naming: Selects events by full signature and disambiguates overloaded event names with custom aliases like TransferERC20 and TransferERC721.
  • Environment Variables and Validation: Interpolates ENVIO_-prefixed variables with defaults and nesting, plus YAML schema validation via a language-server directive.
  • Use Case: When setting up a multichain indexer for an ERC-20 token deployed at different addresses on Ethereum and Polygon, use this Skill to write the config.yaml with per-chain start blocks, multiple contract addresses, and an RPC URL pulled from an environment variable.

Quick Start

Write a HyperIndex config.yaml for my ERC-20 token contract at address 0x1234 on Ethereum mainnet starting from block 18000000 indexing Transfer events.

Frequently Asked Questions about indexer-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a HyperIndex config.yaml for multiple chains?

Define a chains array where each entry has an id, start_block, and contracts list with names and addresses. Each chain can override start_block per contract, and contracts are declared once at the top level with their ABI file path and events.

How do I index a contract deployed at multiple addresses?

Provide the address field as a YAML list of addresses under the contract entry in the chain. Omitting the address entirely enables wildcard indexing of all contracts matching the ABI chain-wide.

How do I handle two events with the same name in config.yaml?

Write each event with its full signature and assign a unique name field to disambiguate, such as TransferERC20 and TransferERC721. Handlers then reference these custom names instead of the raw event name.

Can I use environment variables in HyperIndex config.yaml?

Yes, interpolate variables with ${ENVIO_VAR} syntax in any string value, with optional defaults via ${ENVIO_VAR:-default} and nested fallback expressions. All variables must use the ENVIO_ prefix or they will not be available on the hosted service.

What does start_block 0 mean in HyperIndex configuration?

Setting start_block to 0 tells HyperSync to auto-detect the first block containing matching events, skipping empty blocks automatically. A per-contract start_block overrides the chain-level value when both are set.

Which config.yaml options are deprecated in HyperIndex?

Deprecated options include loaders, preload_handlers, preRegisterDynamicContracts, event_decoder, rpc_config, and unordered_multichain_mode. Use the async handler API, contractRegistrations, and the rpc field under chains instead.