Subgraph for the Primordium smart contracts.
This project uses pnpm for managing packages.
pnpm install
To generate the subgraph ABI schemas:
pnpm codegen
The subgraph manifest can be generated using the mustache template file subgraph.template.yaml
and a network config JSON file from the ./config
directory. Use the prepare:[network]
script for the network to generate the manifest for.
To run locally:
-
Start an anvil instance at port 8545 and deploy the contracts
NOTE: When starting a fresh anvil instance to index, you will need to delete the "./data" folder before starting the graph-node.
-
Start the graph node locally using docker:
pnpm graph-node
-
Deploy the anvil subgraph template to the graph node (the below command creates the proper subgraph.yaml manifest with the mustache template and additionally creates the subgraph on the local Graph Node prior to deploying):
pnpm deploy:local
More info on local deployment here.