Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Envio is a feature-rich indexing solution that provides developers with a seamless and efficient way to index and aggregate real-time or historical blockchain data for any EVM. The indexed data is easily accessible through custom GraphQL queries, providing developers with the flexibility and power to retrieve specific information.
Envio offers native support for Harmony (both testnet and mainnet) and has been designed to support high-throughput blockchain applications that rely on real-time data for their business requirements.
Designed to optimize the user experience, Envio offers automatic code generation, flexible language support, quickstart templates, and a reliable cost-effective hosted service.
Indexers on Envio can be written in JavaScript, TypeScript, or ReScript.
Envio supports HyperSync on Harmony mainnet.
HyperSync is an accelerated data query layer for the Harmony blockchain, providing APIs that bypass JSON-RPC for 20-100x faster syncing of historical data. HyperSync is used by default in Envio's indexing framework, with the use of RPC being optional. Using HyperSync, application developers do not need to worry about RPC URLs, rate-limiting, or managing infrastructure and can easily sync large datasets in a few minutes, something that would usually take hours or days using RPC.
HyperSync is also available as a standalone API for data analytic use cases. Data analysts can interact with the HyperSync API using JavaScript, Python, or Rust clients and extract data in JSON, Arrow, or Parquet formats. For more information, visit the HyperSync documentation here.
Contract Import: Autogenerate the key boilerplate for an entire Indexer project off a single or multiple smart contracts. Deploy within minutes.
Multi-chain Support: Aggregate data across multiple networks into a single database. Query all your data with a unified GraphQL API.
Asynchronous Mode: Fetch data from off-chain storage such as IPFS, or contract state (e.g. smart contract view functions).
Quickstart Templates: Use pre-defined indexing logic for popular OpenZeppelin contracts (e.g. ERC-20).
Users can choose whether they want to start from a quickstart template, perform a subgraph migration, or use the contract import feature.
The following files are required from the user to run the Envio indexer:
Configuration (defaults to config.yaml
)
GraphQL Schema (defaults to schema.graphql
)
Event Handlers (defaults to src/EventHandlers.*
depending on the language chosen)
These files are auto-generated according to the template and language chosen by running the envio init
command.
This walkthrough explains how to initialize an indexer using a single or multiple contracts that are already deployed on a blockchain. This process allows a user to quickly and easily start up a basic indexer and a queryable GraphQL API for their blockchain application within a few minutes.
cd
into the folder of your choice and run
Name your indexer
Choose the directory where you would like to setup your project (default is the current directory)
Select Contract Import
as the initialization option.
Block Explorer option only requires user to input the contracts address and chain of the contract. If the contract is verified and deployed on one of the supported chains, this is the quickest setup as it will retrieve all needed contract information from a block explorer.
Please note: Block explorer option currently only supports networks with etherscan. If the network doesnt have etherscan, you can proceed using the Local ABI option.
Choosing Local ABI
option will allow you to point to a JSON file containing the smart contract ABI. The Contract Import
process will then populate the required files from the ABI.
config.yaml
fileNote if you are using a proxy contract with an implementation, the address should be for the proxy.
The Contract Import
process will prompt the user whether they would like to finish the import process or continue adding more addresses for same contract on same network, addresses for same contract on different network or a different contract.
For more information on contract import feature, visit the documentation here.
Click here for Envio Indexer Examples.
Indexing can be a rollercoaster, especially for more complex use cases. Our engineers are available to help you with your data availability needs.
Join our growing community of elite builders, and find peace of mind with Envio.
Email: hello@envio.dev
Getting historical data on a smart contract can be frustrating when building a dapp. provides an easy way to query smart contract data through APIs known as subgraphs. The Graph’s infrastructure relies on a decentralized network of indexers, enabling your dapp to become truly decentralized.
Harmony One is supported by The Graph.
These subgraphs only take a few minutes to set up. To get started, follow these three steps:
Initialize your subgraph project
Deploy & Publish
Query from your dapp
Here’s a step by step walk through:
Go to the and connect your wallet. Once your wallet is connected, you can begin by clicking “Create a Subgraph”. When choosing a name, it is recommended to use Title Case: “Subgraph Name Chain Name.”
You will then land on your subgraph’s page. All the CLI commands you need will be visible on the right side of the page:
On your local machine run the following:
You can copy this directly from your subgraph page to include your specific subgraph slug:
You’ll be prompted to provide some info on your subgraph like this:
Simply have your contract verified on the block explorer and the CLI will automatically obtain the ABI and set up your subgraph. The default settings will generate an entity for each event.
First run these commands:
Then run these to authenticate and deploy your subgraph. You can copy these commands directly from your subgraph’s page in Studio to include your specific deploy key and subgraph slug:
You will be asked for a version label. You can enter something like v0.0.1, but you’re free to choose the format.
You can test your subgraph by making a sample query in the playground section. The Details tab will show you an API endpoint. You can use that endpoint to test from your dapp.
Once your subgraph is ready to be put into production, you can publish it to the decentralized network. On your subgraph’s page in Subgraph Studio, click on the Publish button:
Before you can query your subgraph, Indexers need to begin serving queries on it. In order to streamline this process, you can curate your own subgraph using GRT.
When publishing, you’ll see the option to curate your subgraph. As of May 2024, it is recommended that you curate your own subgraph with at least 3,000 GRT to ensure that it is indexed and available for querying as soon as possible.
Congratulations! You can now query your subgraph on the decentralized network!
For any subgraph on the decentralized network, you can start querying it by passing a GraphQL query into the subgraph’s query URL which can be found at the top of its Explorer page.
The query URL for this subgraph is:
https://gateway-arbitrum.network.thegraph.com/api/
[api-key]/subgraphs/id/HdVdERFUe8h61vm2fDyycgxjsde5PbB832NHgJfZNqK
Now, you simply need to fill in your own API Key to start sending GraphQL queries to this endpoint.
In Subgraph Studio, you’ll see the “API Keys” menu at the top of the page. Here you can create API Keys.
This query shows the most expensive CryptoPunks sold.
Passing this into the query URL returns this result:
💡 Trivia: Looking at the top sales on [CryptoPunks website](https://cryptopunks.app/cryptopunks/topsales) it looks like the top sale is Punk #5822, not #9998. Why? Because they censor the flash-loan sale that happened.
Harmony version of the Ganache is also available .
A quick guide on how to verify your contracts on Harmony.
Right now, we support verification only for one single solidity file - therefore, before deployment and verification, you will need to flatten all solidity sources to one file.
To flatten your solidity files we recommended to use
Or you can use any other flattener lib
To more easy verification we recommend to deploy contract with Harmony Remix
You can verify your contract here
Important to use correct params (the same like on deploy):
Contract address
Contract name
Compiler version
Optimizer
Chain Type (mainnet or testnet)
Sources
Imported libs
Then click Submit button
If all parameters are correct - you should to see Success
message, or Error
if bytecodes don't equal
On Success case - you contract will verify and you will see all contract details on contract explorer page
Example for Harmony Remix:
This page describes how to use ganache-cli to connect to Harmony networks.
Install Ganache CLI
Load Harmony networks (local, testnet, mainnet) to ganache-cli. The command below loads
Use web3.js to interact with the ganache binded harmony network
A web3-react toolkit for Harmony wallets
adds support for using OneWallet and MathWallet together with .
Harmony-React is not a fork of web3-react, but rather built on top of web3-react to ensure that the library can be upgraded whenever web3-react gets updated.
Add web3-react/core
and the wallets you want to use (OneWallet, MathWallet or both) to package.json
:
Install using yarn install
or npm install
.
Import packages:
Instantiate wallets:
Store the wallet references in a store or a suitable structure, e.g:
Create a wallet connection/unlock modal (or other suitable UI element):
Implement the Unlock
component:
And finally, implement the WalletComponent
:
For full reference implementations of Store
, UnlockModal
, Unlock
, and WalletComponent
:
Note: The Graph's smart contracts are all on Arbitrum One, even though your subgraph is indexing data from Ethereum, BSC or any other .
Here’s an example from the by Messari:
To explore all the ways you can optimize & customize your subgraph for a better performance, read more about .
For more information about querying data from your subgraph, read more .
To get ABI-encoded constructor arguments you can ue this service:
1 - click ABI to copy it
2 - paste ABI to form and click parse
3 - paste your constuctor arguments and click Copy
4 - paste encoded constructor arguments to verify form field
For a more in-depth implementation example check .
Store
:
UnlockModal
:
Unlock
:
WalletComponent
: