You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
* Subgraph schema update to capture new events, and deployment refactor to support rapid subgraph development and testing
* Resolved local Hardhat network state deployment and updated subgraph schema to index new StreamingFeeModule and TradeModule events
* Add subgraph query example
* [lev-173-subgraph-migration-rollout] Added old subgraph schema entities/fields to prevent breaking changes to front-end on new subgraph sync. Deprecated entries must be removed after new subgraph sync and test.
|`clean [-- all\|subgraph\|hardhat]`| Clean up local subgraph deployment; `all` arg additionally removes all volumes and the Hardhat node. |
69
+
|`deploy-hardhat -- /path/to/file.ts`| Deploy a local Hardhat node and run a test script. Must specify full path to file as task input argument. |
70
+
|`deploy-hosted [-- detach]`| Build and deploy subgraph on Hosted Service; `detach` runs container detached. |
71
+
|`deploy-local [-- detach]`| Build and deploy subgraph on local network; `detach` runs container detached. |
72
+
|`docker-build`| Build subgraph Docker image on defined node version base (default: 16-slim). |
73
+
|`gen-abi`| Pull latest Set Protocol ABIs into the build environment. |
74
+
|`gen-schema`| Compile the subgraph schema but do not deploy the subgraph. |
52
75
53
76
## [TO-DO] ADVANCED DEPLOYMENT GUIDES
54
77
55
-
TBD: Things to be covered in this section
78
+
TBD: Ideas to be covered in this section
56
79
57
80
- custom override of args (requires custom untracked .env configs or CLI arg overrides)
58
81
- the [Set Protocol V2 repo](https://github.com/SetProtocol/set-protocol-v2.git) currently requires node <= 16; therefore, Node 16 is the default target base image used in the Subgraph Docker image.
@@ -61,9 +84,12 @@ TBD: Things to be covered in this section
61
84
62
85
## [TO-DO] SUBGRAPH DEVELOPMENT
63
86
64
-
### Tutorial
87
+
### [TEMP] Dev Notes
65
88
66
-
TBD
89
+
- Each named dataSource or template entry should be in its own mappings/<entity>.ts file
90
+
- Entity names cannot end with "s" due to conflict with query API (not currently documented)
91
+
- Use `setToken` for schema fields, not `set` as will conflict will built-in callers
92
+
- Templates must be initialized appropriately (see `ModuleInitialize` event handler for example)
67
93
68
94
### Reference Guide
69
95
@@ -81,7 +107,7 @@ To Be Completed
81
107
82
108
`src/mappings/` - Event handlers
83
109
84
-
`src/entities/` - Entity helper functions
110
+
`src/utils/` - Entity helper functions and other utilities
85
111
86
112
#### Historical Entities
87
113
@@ -114,12 +140,12 @@ Prefixes:
114
140
115
141
#### Event/Call/Block Handlers
116
142
117
-
Process events, function calls, and block data to update the subgraph. Must register handlers in `templates/subgraph.yaml`.
143
+
Process events, smart contract function calls, and block data to update the subgraph. Must register handlers in `templates/subgraph.yaml`.
118
144
119
145
#### Template spawners
120
146
121
147
Not all contract addresses are known at the time of subgraph deployment. To track contracts as they are deployed, use contract templates.
122
-
Tell the subgraph to watch a newly created contract by calling create() on imports from `generated/templates`. Ex the SetToken factory contract (SetTokenCreator) emits an event when a new SetToken is created, so we register that address as a new SetToken contract to watch. Templates are defined in `templates/subgraph.yaml`.
148
+
Tell the subgraph to watch a newly created contract by calling `create()` on imports from `generated/templates`. For example, the SetToken factory contract (SetTokenCreator) emits an event when a new SetToken is created, so we register that address as a new SetToken contract to watch. Templates are defined in `templates/subgraph.yaml`.
0 commit comments