HyperIndex Quickstart
The Quickstart enables you to instantly autogenerate a powerful blockchain indexer and start querying blockchain data in minutes. This is the fastest and easiest way to begin using HyperIndex. If you are new to indexing, see what a blockchain indexer is for the wider context.
Example: Autogenerate an indexer for the Eigenlayer contract and index its entire history in less than 5 minutes by simply running pnpx envio init and providing the contract address from Etherscan.
Prerequisites
-
22.15.0 or newer
-
recommended but not required
-
required to run the Envio indexer locally
Docker is only required if you plan to run your indexer locally. You can skip installing Docker if you'll only be using Envio Cloud. Podman also works if you prefer it to Docker.
Additionally for Windows Users:
- WSL Windows Subsystem for Linux
Getting Started
Run the following command to initialize your blockchain indexer:
pnpx envio init
You'll then follow interactive prompts to customize your indexer: a folder name, the blockchain ecosystem (Evm, Svm or Fuel), how to start, and an Envio API token for your .env file.
To run envio init without prompts, for example from a script or an AI agent, see Non-interactive envio init.
Hand It to an AI Agent
Most of the time you can give this step to an AI coding assistant such as Claude Code, Codex or Cursor. Tell it what to index:
Run `ENVIO_TUI=false pnpx envio init` and build an indexer that tracks WETH deposits and withdrawals on Ethereum.
If a command fails, check "If Your Agent Gets Stuck" in https://docs.envio.dev/docs/HyperIndex/quickstart.md before trying anything else.
ENVIO_TUI=false tells envio init it's talking to an agent. Most agents are detected without it, but an agent that runs commands in a real terminal would otherwise get the interactive prompts and sit waiting for answers. In agent mode, envio init prints a plan and exits with code 2, and the agent runs it again with every answer passed as a flag:
pnpx envio init contract-import explorer \
-n weth-indexer \
-c 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
-b ethereum-mainnet \
--single-contract --all-events \
-d weth-indexer
That writes the project with its tests and agent skills in .claude/skills/, and cd weth-indexer && pnpm test passes straight away. From there the agent extends the tests and handlers until the indexer does what you asked. Quickstart with AI covers the whole loop, through to deploying on Envio Cloud.
If Your Agent Gets Stuck
These are the ways envio init can fail under an agent, with the message to look for and the fix that works:
-
It stops at
Specify a folder nameand waits. The agent runs commands in a real terminal, soenvio initshowed the interactive prompts. Stop it and run the command again withENVIO_TUI=falsein front. -
invalid value '1' for '--blockchain <BLOCKCHAIN>'. Withexplorer,-btakes a network name such asethereum-mainnet,baseoroptimism, not a chain ID, even though the printed plan says-b ${chainId}. The error lists every accepted name. -
Running non-interactively but no Envio API token was provided. SetENVIO_API_TOKEN, or put--api-token <token>straight afterenvio init. If you don't have a token, ask the user for one: they can create it at envio.dev/app/api-tokens. -
Failed to find the verified contract on a block explorer, thenThe input device is not a TTY. The contract isn't verified, so retryingexplorerwon't help. Save the contract's ABI as a JSON file (an array of only the events you need is enough) and import it withlocal, where-balso takes a chain ID:pnpx envio init contract-import local \
-a ./abis/MyContract.json --contract-name MyContract \
-c <ADDRESS> -b 1 \
--single-contract --all-events \
-d my-indexer -
It can't open a docs URL. Read the page with
pnpx envio tools fetch-docs <url>, or search withpnpx envio tools search-docs "<query>". Both print plain text and need no token.
Indexer Initialization Options
After choosing the Evm ecosystem, you'll be asked how to start. The first two options import an existing contract (recommended); the others create a project from a template:
? Choose an initialization option
> From Address - Lookup ABI from block explorer
From ABI File - Use your own ABI file
Template: ERC20
Template: Greeter
Feature: External Calls
Feature: Factory Contract
[↑↓ to move, enter to select, type to filter]
Contract Import Methods
There are two convenient methods to import your contract:
- From Address (verified contracts on supported explorers like Etherscan and Blockscout)
- From ABI File (custom or unverified contracts)
1. Block Explorer Import
This method uses a verified contract's address from a supported blockchain explorer (Etherscan, Routescan, etc.) to automatically fetch the ABI. The CLI fetches it through Envio's API at envio.dev, so that host must be reachable. If the lookup fails, for example because the contract isn't verified, envio init asks for a local ABI file instead: continue with Local ABI Import from step 2.
Steps:
Select the blockchain
? Which blockchain would you like to import a contract from?
> abstract
amoy
arbitrum-nova
arbitrum-one
...
[↑↓ to move, enter to select, type to filter]NoteHyperIndex supports all EVM-compatible chains. If your desired chain is not listed, you can import via the local ABI method or manually adjust the
config.yamlfile after initialization.Enter the contract address
? What is the address of the contract?
[Use the proxy address if your abi is a proxy implementation]TipIf using a proxy contract, always specify the proxy address, not the implementation address.
Select events to index
? Which events would you like to index?
> [x] ClaimRewards(address indexed from, address indexed reward, uint256 amount)
[x] Deposit(address indexed from, uint256 indexed tokenId, uint256 amount)
[x] NotifyReward(address indexed from, address indexed reward, uint256 indexed epoch, uint256 amount)
[x] Withdraw(address indexed from, uint256 indexed tokenId, uint256 amount)
[↑↓ to move, space to select one, → to all, ← to none, type to filter]Finish or add more contracts
You'll be prompted to continue adding more contracts or to complete the setup:
? Would you like to add another contract?
> I'm finished
Add a new address for same contract on same network
Add a new network for same contract
Add a new contract (with a different ABI)
2. Local ABI Import
Choose this method if the contract ABI is unavailable from a block explorer or you're using an unverified contract.
Steps:
Select From ABI File
Choose
From ABI File - Use your own ABI filein the initialization options.Specify ABI JSON file
Provide the path to your local ABI file (JSON format). Either a bare ABI array or a Hardhat or Foundry build artifact with an
abikey works. For a proxy, use the implementation's ABI with the proxy address:? What is the path to your json abi file?Select events to index
? Which events would you like to index?
> [x] ClaimRewards(address indexed from, address indexed reward, uint256 amount)
[x] Deposit(address indexed from, uint256 indexed tokenId, uint256 amount)
[↑↓ to move, space to select one, → to all, ← to none, type to filter]Choose blockchain
Specify the blockchain your contract is deployed on:
? Choose network:
> <Enter Network Id>
abstract
amoy
arbitrum-nova
...
[↑↓ to move, enter to select, type to filter]Choose
<Enter Network Id>for a chain that isn't listed. For a chain HyperSync doesn't support, you'll be asked for an RPC URL and a start block.Enter contract details
- Contract name
? What is the name of this contract?- Contract address
? What is the address of the contract?
[Use the proxy address if your abi is a proxy implementation]Finish or add more contracts
Complete the import process or continue adding contracts:
? Would you like to add another contract?
> I'm finished
Add a new address for same contract on same network
Add a new network for same contract
Add a new contract (with a different ABI)
Generated Files & Configuration
The Quickstart automatically generates key files:
1. config.yaml
Automatically configured parameters include:
- Network ID
- Start Block (
0on chains HyperSync supports, where HyperSync skips ahead to the first block with your events; otherwise the start block you entered) - Contract Name
- Contract Address
- Event Signatures
By default, all selected events are included, but you can manually adjust the file if needed. See the detailed guide on config.yaml.
2. GraphQL Schema
- Entities are automatically generated for each selected event.
- Fields match the event parameters emitted.
See more details in the schema file guide.
3. Event Handlers
- Handlers are autogenerated for each event.
- Handlers create event-specific entities.
Learn more in the event handlers guide.
Congratulations! Your HyperIndex indexer is now ready to run and query data!
Next step: Running your Indexer locally or Deploying to Envio Cloud.
Other Ways to Start
Contract Import is the recommended path, but you can also bootstrap an indexer from:
- Templates - pre-built
ERC20or Greeter projects, selectable from thepnpx envio initinteractive prompt. - Examples - copy and adapt an existing indexer from our Examples, our Tutorials, or the GitHub repositories.