You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Graph is a indexing protocol and be used to create subgraphs on SKALE Chain data. You can reach out to the Graph community to request a Graph node, or you may run your own Graph node. These instructions assume you are using a Testnet or Mainnet SKALE Chain and are running your own graph node.
For proper compatibility, you must point a Graph node to a SKALE Archive node.
Install Prerequisites
docker
docker-compose
nodejs
npm
yarn
truffle
Get a SKALE Endpoint
Get the SKALE chain endpoint assigned to your project here OR use your your own dedicated chain as available.
Configure a Graph Node
git clone https://github.com/graphprotocol/graph-node/
cd graph-node/docker
truffle test --network skale test/myToken.test.forgraph.js
Expected output:
MyToken
...
✓ In the test (237ms)
1 passing (242ms)
Execute token test
truffle test --network skale test/myToken.test.js
Output:
...
MyBalance
✓ enough account balance
MyToken
✓ deploys a contract
✓ has a default token value (1042ms)
✓ can update token value (1042ms)
4 passing (3s)
The Graph
The Graph is a indexing protocol and be used to create subgraphs on SKALE Chain data. You can reach out to the Graph community to request a Graph node, or you may run your own Graph node. These instructions assume you are using a Testnet or Mainnet SKALE Chain and are running your own graph node.
For proper compatibility, you must point a Graph node to a SKALE Archive node.
Get a SKALE Endpoint
Get the SKALE chain endpoint assigned to your project here OR use your your own dedicated chain as available.
Configure a Graph Node
git clone https://github.com/graphprotocol/graph-node/ cd graph-node/docker
Then modify the
docker-compose.yml
file:<1> Replace with your SKALE Chain endpoint if not using the SKALE-IMA-SDK.
<2> Add this if using
host.docker.internal
on a Linux machine.To follow the container output, run
docker logs docker_graph-node_1 --follow
In another terminal on the same machine, execute:
git clone https://github.com/skalenetwork/se-integrations/ cd se-integrations/graph-protocol/
Modify the .env file.
<1> You will add the contract address in step 7.
<1> Change from
mainnet
toskale
to match docker-compose.yml in graph-node.<2> Replace with deployed contract address.
Add deployed MyToken contract address to .env file
Execute yarn
yarn && yarn codegen
Expected output:
Expected output in Graph-node container:
Dec 17 23:18:38.892 INFO Received subgraph_create request, params: SubgraphCreateParams { name: SubgraphName("skaleToken") }, component: JsonRpcServer
Expected output in graph-node container:
truffle test --network skale test/myToken.test.forgraph.js
Expected output:
MyToken ... ✓ In the test (237ms) 1 passing (242ms)
truffle test --network skale test/myToken.test.js
Output:
http://localhost:8000/subgraphs/name/skaleToken/graphql
Expected output:
The text was updated successfully, but these errors were encountered: