Initialize a new HyperIndex indexer project with guided setup
Initialize a new Envio HyperIndex indexer project by importing a contract from a block explorer or using a template. Use this when you need to set up an indexer for any EVM contract—provide a contract address and network, or search for a protocol's address if unknown.
/plugin marketplace add enviodev/envio-plugins/plugin install envio-hyperindex@envio-pluginscontract-address-or-typeInitialize a new Envio HyperIndex indexer project using envio init with non-interactive CLI flags.
IMPORTANT: The interactive CLI does not work well with agents. Always use the fully-specified command-line flags to avoid interactive prompts.
Check $ARGUMENTS for:
0x)erc20, greeter)If NO contract address or template provided:
eth for Ethereum mainnet)envio-indexer)If contract address IS provided:
Use the fully non-interactive command with all flags specified:
pnpx envio init contract-import explorer \
-c <CONTRACT_ADDRESS> \
-b <NETWORK_ID> \
-n <PROJECT_NAME> \
-l typescript \
-d <DIRECTORY_NAME> \
--single-contract \
--all-events \
--api-token ""
pnpx envio init contract-import explorer \
-c 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f \
-b ethereum-mainnet \
-n uniswap-v2-indexer \
-l typescript \
-d uniswap-v2-indexer \
--single-contract \
--all-events \
--api-token ""
| Flag | Description | Required |
|---|---|---|
-c, --contract-address | Contract address to import | Yes |
-b, --blockchain | Network ID (see network list below) | Yes |
-n, --name | Project name | Yes |
-l, --language | Handler language: typescript, javascript, rescript | Yes |
-d, --directory | Output directory for the project | Yes |
--single-contract | Skip prompt for additional contracts | Recommended |
--all-events | Index all events without prompting | Recommended |
--api-token | HyperSync API token (use "" for public access) | Recommended |
If contract import fails (e.g., unverified contract, network issues), use template initialization:
pnpx envio init template \
-t erc20 \
-n <PROJECT_NAME> \
-l typescript \
-d <DIRECTORY_NAME> \
--api-token ""
| Template | Description | Use Case |
|---|---|---|
erc20 | ERC20 token transfers | Token tracking, balances |
greeter | Simple example | Learning, testing |
After template init, you'll need to manually update config.yaml with the actual contract address and network.
After init completes successfully:
cd <DIRECTORY_NAME>
pnpm install
pnpm codegen
Check that these files were created:
config.yaml - Contract addresses, networks, eventsschema.graphql - GraphQL entity definitionssrc/EventHandlers.ts - Event handler stubsRead and review each file to understand what was generated.
pnpm dev
This starts the indexer locally with hot reload and Hasura GraphQL console.
Use these values for the -b / --blockchain flag.
| Network | CLI Value |
|---|---|
| Ethereum | ethereum-mainnet |
| Polygon | polygon |
| Arbitrum One | arbitrum-one |
| Arbitrum Nova | arbitrum-nova |
| Optimism | optimism |
| Base | base |
| Avalanche | avalanche |
| BSC | bsc |
| Gnosis | gnosis |
| Fantom | fantom |
| Linea | linea |
| Scroll | scroll |
| zkSync Era | zksync-era |
| Blast | blast |
| Mode | mode |
| Manta | manta |
| Mantle | mantle |
| Moonbeam | moonbeam |
| Celo | celo |
| Aurora | aurora |
| Harmony | harmony |
| Sonic | sonic |
| Berachain | berachain |
| Monad | monad |
| Abstract | abstract |
| Worldchain | worldchain |
| Unichain | unichain |
| Zora | zora |
| Network | CLI Value |
|---|---|
| Sepolia | sepolia |
| Holesky | holesky |
| Base Sepolia | base-sepolia |
| Arbitrum Sepolia | arbitrum-sepolia |
| Optimism Sepolia | optimism-sepolia |
| Scroll Sepolia | scroll-sepolia |
| Linea Sepolia | linea-sepolia |
| Blast Sepolia | blast-sepolia |
| Mode Sepolia | mode-sepolia |
| Monad Testnet | monad-testnet |
| Polygon Amoy | amoy |
Run pnpx envio init contract-import explorer --help to see all supported networks.
Ethereum Mainnet:
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f0x1F98431c8aD98523631AE4a59f267346ea31F9840xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc20xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB480xdAC17F958D2ee523a2206206994597C13D831ec70x6B175474E89094C44Da98b954EescdeCB5BE3bEPolygon:
0x1F98431c8aD98523631AE4a59f267346ea31F9840x5757371414417b8C6CAad45bAeF941aBc7d3Ab32Arbitrum:
0x1F98431c8aD98523631AE4a59f267346ea31F9840x489ee077994B6658eAfA855C308275EAd8097C4ABase:
0x33128a8fC17869897dcE68Ed026d694621f6FDfD0x420DD381b31aEf6683db6B902084cB0FFECe40DaAlways verify addresses with the user or official documentation before indexing.
pnpx envio init contract-import explorer --helpethereum-mainnet, arbitrum-one)Use local ABI import instead:
pnpx envio init contract-import local \
-a ./path/to/abi.json \
-c <CONTRACT_ADDRESS> \
-b <NETWORK_ID> \
--contract-name <NAME> \
-n <PROJECT_NAME> \
-l typescript \
-d <DIRECTORY_NAME> \
--single-contract \
--all-events \
--api-token ""