Running a Graph Node on REI Network
This document describes how set up a local graph node for REI network
The Graph is a decentralized protocol for indexing and querying data from blockchains, starting with Ethereum. It makes it possible to query data that is difficult to query directly. Graph nodes which source events from blockchain to deterministically update a data store that can be queried via the GraphQL endpoint
There are two ways to launch a Graph Node: you can use Docker to run related images, or you can compile their Source code. The steps described in this document will only be run through docker, because it is more convenient, and you can launch a Graph Node very quickly.
The steps described in this guide have been tested in both Ubuntu 20.04-based and MacOs environments, and they will need to be adapted accordingly for other systems.
Before you start, you need some pre-environment configuration on your system:
In this guide, you will learn how to run a Graph node against a node with the REI testnet node.This guide can also be adapted for mainnet.
git clone https://github.com/graphprotocol/graph-node/
Then execute the
setup.shfile, this file will pull all the necessary Docker images and write the necessary information into the
The log information returned looks like:
When everything is ready, you should to revise the "Ethereum environment" inside the
docker-compose.ymlfile, so that it points to the endpoint of the node you are running this Graph Node against. Note that the
setup.shfile detects the
Host IPand writes its value, so you'll need to modify it accordingly.
docker-compose.ymlfile should look something similar to:
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
Finally, you can start with the following command：
Wait for a while and you will see the log with the latest block synced：
As you can see, you have a Graph Node running against the REI TestNet. This example is also suitable for mainnet