-
Create a new subgraph fromhttps://thegraph.com/studio/
-
Install Graph CLI with either npm or yarn
-
npm install -g @graphprotocol/graph-cli
-
yarn global add @graphprotocol/graph-cli
-
-
clone this repo
-
Authenticate in CLI, check your subgraph page.
-
Deploy subgraph
-
graph deploy --studio test
-
Since our token contract is a proxy contract, we need to create two subgraphs: the first subgraph should use the address of our proxy contract, and the second subgraph should use the address of our token implementation.
-
Install Graph CLI with either npm or yarn
-
npm install -g @graphprotocol/graph-cli
-
yarn global add @graphprotocol/graph-cli
-
-
Create first subgraph using proxy contract's address
-
graph init --studio your_first_subgraph_name
-
-
Create second subgraph using address of token implementation
-
graph init --studio your_second_subgraph_name
-
-
Merge the content of the following files from the second subgraph into the first subgraph files by copying and pasting.
- Files under
abis
,generated
,src
,tests
. - file
schema.graphql
entities
andeventHandlers
in filesubgraph.yaml
- Files under
-
Authenticate in CLI, check your subgraph page.
-
cd your_first_subgraph_name
-
Build subgraph
-
graph codegen && graph build
-
-
Deploy subgraph
-
graph deploy --studio test
-