Developers Forum for XinFin XDC Network

Eduardo Robles
Eduardo Robles

Posted on

How do i implement a subgraph?

I've been trying to implement a subgraph using graph-protocol's graph-node by changing this file to have ethereum: 'mainnet:https://rpc.apothem.network'.

But running docker-compose up with this gives the following error.
Aug 29 20:46:40.700 WARN Trying again after eth_getBlockByNumber(0, false) RPC call failed (attempt #11) with result Err(Decoder error: Error("invalid length 43, expected a (both 0x-prefixed or not) hex string with length of 40", line: 0, column: 0)), provider: mainnet-rpc-0

I was kindly pointed to this post which does say that it is possible to have a subgraph, but haven't been able to tell the difference from my code to the one in the examples.

Can someone point me in the right direction here? What am i missing?

Discussion (5)

Collapse
xu_zhaolin_fcf881856ae0b5 profile image
xu zhaolin • Edited on

please find 3.4 below

3.4 Download graph-node complier,we have modified the graphnode code! Make sure you download it from our github!

sudo apt install -y cmake

cd ${HOME}
git clone github.com/gzliudan/graph-node graph-node.xdc
cd graph-node.xdc
git checkout -b xdc origin/xdc
cargo build --release

Collapse
yohan profile image
Yohan Nelson

This did not seem to work for me, has the implementation changed?

Collapse
gzliudan profile image
Daniel Liu

The latest version is here: github.com/Carry-So/graph-node

Collapse
xu_zhaolin_fcf881856ae0b5 profile image
xu zhaolin

Hi,

We have modified some of the graph source code to make it compatible with xdc network! you must use the code we provide to implement our method.

Collapse
yohan profile image
Yohan Nelson

Hi, I already have a subgraph for the protocol I am working on. We are testing it on apothem. We already have a graph-indexer and its unique mappings etc. How do we deploy the subgraph for apothem testnet?
I checked the repo: github.com/gzliudan/graph-node but how do run our own mappings and addresses from this repo ?