-
Notifications
You must be signed in to change notification settings - Fork 13
Description
There are some files that should probably be git-ignored:
packages/subgraph/abis/BatchRegistry.json Is "copied" by packages/subgraph/scripts/abi_copy.ts
So if that file is going to be autogenerated:
- we should not edit it manually
- we should not track any version of it (its automatically copied by a script)
packages/subgraph/subgraph.yaml is also autogenerated by /prepare-local-manifest.ts parsing subgraph.template.yaml
Appart from that the graph local DX could be improved:
Improve root README.md
Our main readme assumes knowledge of how to run the repo, but we should explicitly state how to run the repo.
Basic flow is specified in issue #12
We also need to add the steps to run a local graph node (and deploy the subgraph locally):
0.1 $ yarn chain runs a local node with hardhat
0.2 $ yarn deploy deploy our contracts on local node
$ yarn subgraph:clean-nodecleans prev data (we will run and deploy everything from scratch)$ yarn subgraph:run-nodespins up a local graph node (analogous to yarn chain)$ yarn subgraph:local-createCompiles the subgraph$ yarn subgraph:local-shipDeploys the subgraph on our local graph node$ yarn subgraph:stop-nodeStops our node (once we finsish developing)
The above instructions are a draft I made. But it lacks:
- dependency installations
- Other Pre-requisites: we need node, we need yarn, we need docker
Improve 00_deploy_your_contract.ts (or create another deploy script file)
Only for our local graph development it would be nice to have some random builders checkd in.
This would allow us to query them via our subgraph.
Without this, its difficult to be sure our subgraph works as expected.
⚠️ Buidl Guidl team might not want us to include a contract that shows how to do a checkIn.
A way to overcome this could be:
- Have the CheckIn.sol (or whatever name) contract gitignored
- Describing the function name that our deploy script will use (just the name)
- Use it in our script (and having an error log in the script if the file is not there)
Creating a .env.local
This env could be commited and should not include any sensitive key.
The only value I would add to it for the moment would be:
NEXT_PUBLIC_SUBGRAPH_URL='http://localhost:8000/subgraphs/name/buidlguidl/batch23-subgraph'
So local development enviroment hits our local subgraph (and we avoid rate-limiting our deployed subgraph)