Skip to content

Commit 46b322d

Browse files
author
SvenMuller95
committed
adds envio to polygon docs as supported data indexer
1 parent 85c15b2 commit 46b322d

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed

docs/tools/data/envio.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
!!! note "Content disclaimer"
2+
3+
Please view the third-party content disclaimer [here](https://github.com/0xPolygon/polygon-docs/blob/main/CONTENT_DISCLAIMER.md).
4+
5+
6+
# Envio HyperIndex
7+
8+
[Envio](https://envio.dev/) HyperIndex 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.
9+
10+
Envio offers native support for Polygon PoS (testnet & mainnet), Polygon zkEVM (testnet & mainnet), and Polygon CDK chains, and has been designed to support high-throughput blockchain applications that rely on real-time data for their business requirements.
11+
12+
Designed to optimize the user experience, Envio offers automatic code generation, flexible language support, quickstart templates, and a reliable cost-effective [hosted service](https://docs.envio.dev/docs/hosted-service).
13+
14+
Indexers on Envio can be written in JavaScript, TypeScript, or ReScript.
15+
16+
## Envio HyperSync
17+
18+
Envio supports [HyperSync](https://docs.envio.dev/docs/hypersync) on Polygon networks.
19+
20+
HyperSync is an accelerated data query layer for the Polygon networks, providing APIs that bypass JSON-RPC for 100x faster syncing of historical data. HyperSync is used by default in Envio HyperIndex, 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 via RPC.
21+
22+
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](https://docs.envio.dev/docs/overview-hypersync).
23+
24+
25+
## HyperIndex Key Features
26+
27+
- Contract Import: Autogenerate the key boilerplate for an entire Indexer project off a single or multiple smart contracts. Deploy within minutes.
28+
29+
- Multi-chain Support: Aggregate data across multiple networks into a single database. Query all your data with a unified GraphQL API.
30+
31+
- Asynchronous Mode: Fetch data from off-chain storage such as IPFS, or contract state (e.g. smart contract view functions).
32+
33+
- Factory Contracts: Automatically process events emitted by all child contracts that are created by the specified factory.
34+
35+
- Quickstart Templates: Use pre-defined indexing logic for popular OpenZeppelin contracts (e.g. ERC-20).
36+
37+
38+
## Getting Started
39+
40+
Users can choose whether they want to start from a quickstart template, perform a subgraph migration, or use the contract import feature to get started with Envio HyperIndex.
41+
42+
The following files are required to run the Envio indexer:
43+
44+
- Configuration (defaults to `config.yaml`)
45+
- GraphQL Schema (defaults to `schema.graphql`)
46+
- Event Handlers (defaults to `src/EventHandlers.*` depending on the language chosen)
47+
48+
These files are auto-generated according to the template and language chosen by running the `envio init` command.
49+
50+
### Contract Import Tutorial
51+
52+
This walkthrough explains how to initialize an indexer using a single or multiple contracts that are already deployed on Polygon. This process allows a user to quickly and easily start up a basic indexer and a queryable GraphQL API for their application in less than 3 minutes.
53+
54+
### Intialize your indexer
55+
56+
`cd` into the folder of your choice and run
57+
58+
```bash
59+
envio init
60+
```
61+
62+
Name your indexer
63+
64+
```bash
65+
? Name your indexer:
66+
```
67+
68+
Choose the directory where you would like to setup your project (default is the current directory)
69+
70+
```bash
71+
? Set the directory: (.) .
72+
```
73+
74+
Select `Contract Import` as the initialization option.
75+
76+
```bash
77+
? Choose an initialization option
78+
Template
79+
> ContractImport
80+
[↑↓ to move, enter to select, type to filter]
81+
```
82+
83+
```bash
84+
? Would you like to import from a block explorer or a local abi?
85+
> Block Explorer
86+
Local ABI
87+
[↑↓ to move, enter to select, type to filter]
88+
```
89+
90+
`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.
91+
92+
`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.
93+
94+
#### Select the blockchain that the contract is deployed on
95+
96+
```bash
97+
? Which blockchain would you like to import a contract from?
98+
ethereum-mainnet
99+
arbitrum-one
100+
arbitrum-nova
101+
> polygon
102+
gnosis
103+
v optimism
104+
[↑↓ to move, enter to select, type to filter]
105+
```
106+
107+
#### Enter in the address of the contract to import
108+
109+
```bash
110+
? What is the address of the contract?
111+
[Use the proxy address if your abi is a proxy implementation]
112+
```
113+
114+
Note if you are using a proxy contract with an implementation, the address should be for the proxy contract.
115+
116+
#### Choose which events to include in the `config.yaml` file
117+
118+
```bash
119+
? Which events would you like to index?
120+
> [x] ClaimRewards(address indexed from, address indexed reward, uint256 amount)
121+
[x] Deposit(address indexed from, uint256 indexed tokenId, uint256 amount)
122+
[x] NotifyReward(address indexed from, address indexed reward, uint256 indexed epoch, uint256 amount)
123+
[x] Withdraw(address indexed from, uint256 indexed tokenId, uint256 amount)
124+
[↑↓ to move, space to select one, → to all, ← to none, type to filter]
125+
```
126+
127+
#### Select the continuation option
128+
129+
```bash
130+
? Would you like to add another contract?
131+
> I'm finished
132+
Add a new address for same contract on same network
133+
Add a new network for same contract
134+
Add a new contract (with a different ABI)
135+
[Current contract: BribeVotingReward, on network: polygon]
136+
```
137+
138+
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.
139+
140+
For more information on contract import feature, visit the documentation [here](https://docs.envio.dev/docs/contract-import).
141+
142+
143+
## Envio Examples
144+
145+
Click [here](https://docs.envio.dev/docs/example-uniswap-v3) for Envio HyperIndex examples.
146+
Click [here](https://docs.envio.dev/docs/hypersync-clients) for Envio HyperSync examples.
147+
148+
## Getting Help
149+
150+
Indexing can be a rollercoaster, especially for more complex use cases. Our engineers are available to help you with your data availability needs.
151+
152+
Join our growing community of elite builders, and find peace of mind with Envio.
153+
154+
* [Discord](https://discord.gg/mZHNWgNCAc)
155+
* Email: [hello@envio.dev](mailto:hello@envio.dev)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ nav:
384384
- Entities: tools/data/the-graph/entities.md
385385
- Queries: tools/data/the-graph/queries.md
386386
- Covalent: tools/data/covalent.md
387+
- Envio: tools/data/envio.md
387388
- Flair: tools/data/flair.md
388389
- PARSIQ: tools/data/parsiq.md
389390
- Matic.js:

0 commit comments

Comments
 (0)