0.0.46 • Published 3 years ago
@astraldao/astral-protocol-subgraph v0.0.46
astral-protocol-subgraph
Running the subgraph locally
For more information see the docs on https://thegraph.com/docs/
Prerequisites
- Run
sudo apt-get install libsecret-1-dev
- Docker Instalation
- Run
git clone https://github.com/graphprotocol/graph-node/
(check setup instructions for docker version)
Deployment
- Run a blockchain, e.g. ganache, in a separate terminal with the script in package.json (root folder):
yarn ganache
- Deploy contracts from
astral-protocol-contracts
withyarn truffle
in the root folder. Update addresses in the subgraph configuration if needed - In a third terminal, on the graph-node folder, run
cd docker && docker-compose up
. If using Docker for WSL, Docker must be running on Windows. If graph-node throws an error try clearing thedata/postgres
folder, within the docker directory of graph-node, withsudo rm -rf data/postgres
. Restart docker if needed (WSL) - Generate subgraph typescript files with
yarn codegen
, then create and deploy the subgraph to the graph-node withyarn create-local && yarn deploy-local