How it works
With HyperIndex, you define the contracts and events to index inconfig.yaml, write handlers that turn those events into entities, and query the result through a GraphQL API. Handlers are written in TypeScript (the default) or ReScript. You can run an indexer locally, self-host it, or deploy it to Envio Cloud, Envio’s managed hosting.
HyperSync is Envio’s data retrieval layer, used as an alternative to JSON-RPC. It is available on Celo mainnet (chain ID 42220) at https://celo.hypersync.xyz, and HyperIndex uses it as the default data source there. For networks without HyperSync, such as Celo Sepolia (chain ID 11142220), HyperIndex uses an RPC data source. Celo Sepolia is not in Envio’s network list, so you must supply the ABI and RPC URL yourself rather than importing from a block explorer.
HyperSync is also available as a standalone API through the Node.js, Python, and Rust clients (a community-maintained Go client also exists), or through HyperRPC, its JSON-RPC interface. HyperSync requires an API token.
Prerequisites
- Node.js 22 or newer
- pnpm (recommended)
- Docker Desktop, to run the indexer locally
Create an indexer from a Celo contract
Run the following command and follow the prompts:- Enter a folder name for the project, or press Enter to use the current directory.
- Select
Evmas the blockchain ecosystem. - Select
From Address - Lookup ABI from block explorer. The other options areFrom ABI File(use your own ABI file), two templates (ERC20andGreeter), and two feature examples. - Select
celoas the blockchain. You can type to filter the list. - Enter the contract address. If the contract is a proxy, enter the proxy address.
- Choose the events to index. All events in the ABI are selected by default.
- Select
I'm finished, or add another address, network, or contract. - Add an Envio API token to the project’s
.envfile. You can create a new token or add an existing one.
config.yaml), GraphQL schema (schema.graphql), and event handlers (src/handlers/).
To run contract import without prompts, pass the chain and address as flags:
Run the indexer locally
Make sure Docker is running, then start the indexer from the project folder:testing.
Resources
Related
- Data indexers overview - other indexing options on Celo
- Network overview - Celo chain IDs and RPC URLs