Run the following command to generate the generated folder:
yarn codegenCreate a .env file with the following variables:
MATIC_RPC_URL=docker compose updocker compose downsudo docker rm positions-subgraph_graph-node_1 && sudo docker rm positions-subgraph_ipfs_1 && sudo docker rm positions-subgraph_postgres_1 && sudo docker rm positions-subgraph_ganache_1While local subgraph node is running run:
yarn create-localyarn deploy-localAccess the GraphQL editor at:
http://localhost:8000/subgraphs/name/positions-subgraph/graphql
Example query:
query tokenIdConditions {
tokenIdConditions {
id
condition
complement
}
}Build the subgraph with yarn build and then run the following to deploy:
goldsky subgraph deploy positions-subgraph/<version> --path .To run locally on an M1 chip, you'll need to build a local copy of the graph-node docker image. To do this, clone the graph-node repo and run the following commands:
# Remove the original image
docker rmi graphprotocol/graph-node:latest
# Build the image
./docker/build.sh
# Tag the newly created image
docker tag graph-node graphprotocol/graph-node:latestNote: you likely will have to increase your Docker daemon memory capacity. In Docker desktop you can find this setting under Preferences > Resources > Advanced.