How to use The Graph on Rootstock
The Graph is a decentralized protocol for indexing and querying blockchain data. For more information, visit The Graph.
Rootstock Subgraph
A Subgraph Boilerplate for Rootstock has been developed, this project aims to set up the bricks for easy implementation of a subgraph for the Rootstock Community.
This solution was forked from Sovryn Subgraph.
Example Contract
The subgraph for Rootstock contains an example contract, RootstockEvent
. See deployment on Testnet.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
contract RootstockEvent {
event Log(address indexed sender, string message);
function test() public {
emit Log(msg.sender, "Hello Rootstockers!");
}
}
The subgraph contains the logic for transforming and storing blockchain events, and serving up a publicly available graphQL API for this data.
Note that this is an early version of the subgraph. While it has undergone testing, we are aware that there may be some bugs.
Resources
- Visit Rootstock Subgraph Repo
- Visit The Graph About to learn more.
- Visit Sovryn Subgraph