The Graph
The Graph, a decentralized protocol for indexing and querying blockchain data, now officially supports IoTeX. This integration allows developers to create open APIs, known as subgraphs, to efficiently access and organize data from the IoTeX blockchain. With The Graph, IoTeX developers can enhance their dapps by retrieving information seamlessly, improving functionality and user experience without relying on centralized data providers.
Quick Start
Dapp developers can refer to the official The Graph documentation to create their Subgraphs for IoTeX:
Once the Subgraph is created inside The Graph Studio, it's enough to initialize it as usual with the official CLI and select ethereum as the protocol and iotex as the network:
You can copy the command above directly from your subgraph page to include your specific subgraph slug.
You’ll be prompted to provide some info on your subgraph, make sure you select ethereum
as the protocol, and iotex
as the network:
![](https://docs.iotex.io/~gitbook/image?url=https%3A%2F%2F2460726677-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZW4CBgccC3MHFpijZTPu%252Fuploads%252Fne4FR1lIWbigMBr3R7l4%252Fimage.png%3Falt%3Dmedia%26token%3D9af6f942-c1a8-4bc9-a828-858ab7709366&width=768&dpr=4&quality=100&sign=aa9faa3f&sv=1)
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.
Additional resources
To explore all the ways you can optimize & customize your subgraph for a better performance, read more about creating a subgraph here.
For more information about querying data from your subgraph, read more here.
Last updated