The Graph is a decentralized protocol for indexing and querying data from blockchains, making it possible to query data that is difficult to query directly. In the Graph architexture, Indexers are the primary service provider for data queries: they store and index data, and provide the indexed data as a P2P pay-per-call API service.
To learn more about how The Graph works, we refer yo to the official documentation website:
If you want to use The Graph to query the blockchain data needed for your IoTeX dApp, you can run your Graph Indexer Node by simply editing the
graph-node/docker/docker-compose.ymlconfiguration file such that it points to the a Babel service, the Ethereum-Compatible API Gateway for IoTeX:
You can set
ethereum: testnet:https://babel-api.testnet.iotex.ioif you want to work with the IoTeX testnet instead.
For more information about how to run a Graph Indexer node, please refer to the official documentation at:
Once you have your Indexer Node running, you can define and locally deploy your Subgraphs as usual. Please refer to the official Subgraph quick start guide at:
graph create common/blocks --node https://rpc.graph.mainnet.iotex.io/
graph deploy --debug --ipfs https://ipfs.mainnet.iotex.io --node https://rpc.graph.mainnet.iotex.io/ common/blocks subgraphs/blocks.yaml