Graph Node-supported EVM JSON RPC
Required for a seamless EVM integration
- eth_getLogs
- eth_call (for historical blocks, with EIP-1898 - requires archive node)
- eth_getBlockByNumber
- eth_getBlockByHash
- net_version
- eth_getTransactionReceipt, in a JSON-RPC batch request
- trace_filter (optionally required for Graph Node to support call handlers)
Steps to run Graph Node locally
- Clone Graph Node
- Change this line including your network name and your compatible RPC URL (don’t change the env var name itself, even though it is called
Ethereum
🙂)
- Run an IPFS node or use the one used by The Graph: https://api.thegraph.com/ipfs/
Test the integration by deploying a subgraph locally
- Install graph-cli:
yarn global add @graphprotocl/graph-cli
(Repo here)
- Create a simple example subgraph
- Start with a simple subgraph. Some options are below:
- A basic example: Gravitar (solidity code and tailored subgraph)
- Bootstrap a local subgraph from any existing smart contract/solidity dev environment using Hardhat with a Graph plugin
- Adapt the resulting
subgraph.yaml
file including the same new network name in dataSources.network
(same previously added to Graph Node).
- Create your subgraph in Graph Node:
graph create $SUBGRAPH_NAME --node $GRAPH_NODE_ENDPOINT
- Publish your subgraph to Graph Node:
graph deploy $SUBGRAPH_NAME --ipfs $IPFS_ENDPOINT --node $GRAPH_NODE_ENDPOINT