indexer-local-parallel

Configure per-project Postgres schemas and ports to run multiple Envio indexers locally in parallel.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running two or more Envio HyperIndex projects locally with pnpm dev fails because the CLI creates Docker resources with fixed global names, causing container-name conflicts and one project's migrations clobbering another's data in the shared Postgres.

Core Features & Use Cases

  • Per-project isolation: Set unique ENVIO_PG_SCHEMA and ENVIO_INDEXER_PORT values in each project's .env so multiple indexers share one local Postgres without collisions.
  • Hasura metadata caveat: Explains the last-writer-wins behavior of shared Hasura table tracking and when it matters.
  • Dedicated Hasura workaround: Provides Docker commands to run a second Hasura instance per project, including fixes for enum type search_path, custom root fields, and numeric serialization.
  • Use Case: You are developing three indexers for different chains on one machine and need each syncing simultaneously with its own queryable GraphQL API on separate ports.

Quick Start

Ask the assistant to set up a second Envio indexer project to run locally alongside an existing one without port or database conflicts.

Frequently Asked Questions about indexer-local-parallel

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

FAQPage Schema
How do I run multiple Envio indexers locally at the same time?

Set a unique ENVIO_PG_SCHEMA and ENVIO_INDEXER_PORT in each project's .env file before running pnpm dev. All projects then share the single envio-postgres container while writing to isolated schemas, and each indexer listens on its own port.

Why does my second indexer fail with a Docker container name conflict?

The Envio CLI creates Docker resources with fixed global names like envio-postgres and envio-hasura, so a second project on default settings collides with the first. Assigning per-project schema and port variables lets both projects share the existing containers instead.

Why did my indexer GraphQL API disappear after starting another project?

Each indexer's Hasura table-tracking step replaces shared metadata rather than merging it, so only the most recently started project is queryable on port 8080. Indexing continues in the background; restart the project to re-track its tables or run a dedicated Hasura per project.

How do I fix Hasura enum type errors with a custom Postgres schema?

Entity enums live in the custom schema, but Hasura's generated SQL casts them unqualified, causing type does not exist errors. Append ?options=-c search_path=myschema,public (URL-encoded) to the source database_url so Hasura resolves the enum types.

Is it safe to drop a Postgres schema after stopping an indexer?

Dropping a finished project's schema is safe cleanup and reclaims disk space. Never drop a schema while an indexer is actively syncing into it, as that corrupts the running indexer's state.