TODO write me
First, ensure these are installed:
Next, ensure the Docker daemon is running.
After that, clone the Graph Node project locally,
and navigate to the docker
directory in that project (e.g. cd graph-node/docker
).
If you're on Linux, run ./setup.sh
in that directory to set the host IP address in the docker config.
At this point, it should be possible to run the node: docker-compose up
. Check that its services are running in the logs (GraphQL, Postgres, and IPFS).
Finally, run Ganache on http://0.0.0.0:7545
such that it is available to running Docker images (ganache-cli -p 7545 -h 0.0.0.0
)
yarn
yarn prepare:<config>
(i.eropsten
,local
,staging
,mainnet
)yarn codegen
Firstly, the subgraph can be created by running: yarn create:local
; this should lead to a number of logs on the graph node.
Once the subgraph has been created, it can be deployed at any time with: yarn deploy:local
.
This will cause the graph to start processing blocks and mapping events. Eventually, the subgraph will have been (re)created.
If changes are made to the contracts, subgraph.yaml
, or the GraphQL schema, run yarn codegen
;
this re-create the generated
folder.
NB: Type-checking is performed at build time; yarn tsc
won't work.
yarn
- Ensure correct config in
/config/<config>.json
yarn prepare:<config>
yarn codegen
yarn deploy:<config> <access token>