HyperIndex is a modern, multi-chain data indexing framework for efficiently querying real-time and historical data from any EVM blockchain and Fuel.
Designed with a core focus on delivering superior performance and seamless developer experience, HyperIndex optimizes the user experience.
Build a real-time API for your blockchain application in minutes.
- Simple installation & Setup
- Any EVM blockchain, as well as Fuel
- The fastest historical sync
- Real-time indexing with reorg handling
- Multi-chain support
- Write JavaScript, TypeScript, or ReScript with automatically generated types
- Detailed logging & Error messaging
- Hosted Service to take care of your infrastructure
Install prerequisite tools:
-
Node.js (install v18) https://nodejs.org/en (Recommended to use a node manager like fnm or nvm)
-
pnpm
npm install --global pnpm
-
Cargo https://doc.rust-lang.org/cargo/getting-started/installation.html
curl https://sh.rustup.rs -sSf | sh
-
Docker Desktop https://www.docker.com/products/docker-desktop/
Install Envio:
cargo install --path codegenerator/cli --locked --debug
Command to see available CLI commands
envio --help
Alternatively you can add an alias in your shell config. This will allow you to test Envio locally without manual recompiling.
Go to your shell config file and add the following line:
alias lenvio="cargo run --manifest-path <absolute repository path>/hyperindex/codegenerator/cli/Cargo.toml --"
lenvio
is likelocal envio
😁
Navigate to the cli directory
cd codegenerator/cli
To update all generated docs run
make update-generated-docs
To updated just the config json schemas
make update-schemas
Or to update just the cli help md file
update-help
cd
into folder of your choice and run
envio init
Then choose a template out of the possible options
? Which template would you like to use?
> "Gravatar"
[↑↓ to move, enter to select, type to filter]
Then choose a language from JavaScript, TypeScript or ReScript to write the event handlers file.
? Which language would you like to use?
> "JavaScript"
"TypeScript"
"ReScript"
[↑↓ to move, enter to select, type to filter
This will generate the config, schema and event handlers files according to the template and language chosen.
Our greeter template config.yaml and schema.graphql is an example of how to layout a configuration file for indexing.
Please refer to the documentation website for a thorough guide on all Envio indexer features
Once you have configured the above files and deployed the contracts, the following can be used generate all the code that is required for indexing your project:
envio codegen
Once all the configuration files and auto-generated files are in place, you are ready to run the indexer for your project:
pnpm start