← Protocols
Envio
Indexing / Data·EVM · Solana · Multi-chain

Envio

01Description

Real-time multi-chain indexer (HyperIndex) powered by HyperSync — a high-throughput data layer up to 2000x faster than RPC across 70+ EVM chains, plus Solana and Fuel. Defines indexers via `config.yaml` and TypeScript/ReScript handlers, exposes a hosted GraphQL API.

02Best for
  • 01blazing-fast historical backfills
  • 02multi-chain indexing in one config
  • 03GraphQL over decoded events
  • 04low-latency real-time feeds
  • 05migrating off The Graph hosted service
03Install
  • pnpm add -g envio
  • envio init
04Environment variables
VariableScopeDescription
ENVIO_API_TOKENServerHosted Service deploy token from envio.dev. Used by the CLI (`envio login`) and CI for deployments.
HYPERSYNC_BEARER_TOKENServerOptional bearer token for direct HyperSync API access on rate-limited chains; not needed when running through HyperIndex.
05Prompt snippet
Bootstrap with `envio init`, then declare contracts and events in `config.yaml` (e.g. `networks: [{ id: 1, contracts: [{ name: ERC20, address: [...], events: [Transfer] }] }]`) and `schema.graphql`. Implement handlers in `src/EventHandlers.ts` using the generated `ERC20.Transfer.handler(async ({ event, context }) => { context.Account.set({ id: event.params.to, balance: ... }) })` API. Run `pnpm dev` for local indexing against HyperSync, then `envio deploy` to ship to the Hosted Service. Query the issued GraphQL endpoint with `graphql-request`. Use loaders (`context.Account.load(id)`) to batch DB reads inside handlers for >100x speedups.
06Gotchas
  • HyperSync coverage is 70+ EVM chains plus Solana and Fuel — for any other chain you must configure an `rpc` source in `config.yaml`, which slashes throughput; check https://docs.envio.dev/docs/HyperSync/hypersync-supported-networks before promising a chain.
  • Free Hosted Service tier has request and indexer-count caps; production workloads should use a paid plan or self-host.
  • Schema changes (`schema.graphql` or `config.yaml` event signatures) trigger a full re-index on the Hosted Service — deploy non-breaking additive fields when possible.
  • v3 removed `rpc_config` in favor of `rpc` and changed several handler imports; older tutorials and AI-generated code may still emit the deprecated shape.
  • Real-time mode lags chain head by a few hundred ms via HyperSync, but reorgs > 1 block depth can briefly surface inconsistent state — read `_meta { chainId, blockHeight }` and gate on confirmations.
07Alternatives