indexer-performance

Tune HyperIndex sync speed with HyperSync, batch size, WebSocket, and database index configuration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Blockchain indexers often sync slowly due to RPC bottlenecks, poorly sized event batches, or missing database indexes. This Skill provides concrete configuration guidance for optimizing HyperIndex sync speed and realtime indexing latency.

Core Features & Use Cases

  • HyperSync Data Source: Explains the default HyperSync engine, which delivers up to 1000x faster data access than RPC on supported networks with no configuration required.
  • Batch Size Tuning: Shows how to adjust full_batch_size (default 5000) when handlers make slow Effect API calls that cannot be batched.
  • Realtime WebSocket Config: Demonstrates adding a ws: endpoint with for: realtime for lower-latency new block detection via eth_subscribe("newHeads").
  • Database Indexes: Points to @index schema annotations for faster GraphQL queries, with cross-reference to the indexer-schema skill.
  • Use Case: Your indexer lags behind the chain head during live syncing. Apply the WebSocket realtime configuration to receive new block notifications instantly instead of polling.

Quick Start

Ask the AI to optimize your HyperIndex config.yaml for faster sync speed and realtime block detection.

Frequently Asked Questions about indexer-performance

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

FAQPage Schema
How do I make my HyperIndex indexer sync faster?

HyperSync is the default data source on supported chains and is up to 1000x faster than RPC with no configuration needed. For further tuning, adjust full_batch_size in your config, with 5000 as the default target events per batch.

How to configure WebSocket for realtime blockchain indexing?

Add a ws field to your RPC endpoint configuration with for: realtime to enable lower-latency new block detection via eth_subscribe("newHeads"). Provide the WebSocket URL through an environment variable like ENVIO_WS_ENDPOINT.

When should I reduce the indexer batch size?

Reduce full_batch_size below the default 5000 when your handlers make many slow Effect API calls that cannot be batched. Smaller batches prevent individual slow calls from stalling large event batches.

Does HyperIndex support database indexes for faster queries?

Yes, add @index annotations to schema fields to create database indexes for faster GraphQL queries. The indexer-schema skill documents the full syntax including single-field, composite, and DESC direction indexes.

Why is my indexer slow to detect new blocks?

Default RPC polling introduces latency in detecting new blocks. Configure a WebSocket endpoint with for: realtime to receive push notifications through eth_subscribe("newHeads") instead of polling.