Skip to content

Commit 8de8d10

Browse files
authored
feat(subgraph): Deploy subgraph on Thegraph network (#446)
1 parent 73b90e6 commit 8de8d10

File tree

3 files changed

+42
-16
lines changed

3 files changed

+42
-16
lines changed

packages/subgraph/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ npm run deploy-local
2626

2727
The subgraph will be available at: http://localhost:8000/subgraphs/name/DataProtector/graphql
2828

29+
### Thegraph network
30+
31+
To deploy this subgraph on Thegraph network:
32+
33+
1. Update `networks.json` file to use the correct addresses for the correct network.
34+
35+
2. Authenticate: `npx graph auth <token>`
36+
37+
3. Deploy: `npx graph deploy <slug> --network <name>`
38+
39+
2940
### Hosted Production Environments
3041

3142
We use CI/CD pipelines to deploy our subgraphs to hosted environments.
@@ -53,7 +64,7 @@ For zero-downtime updates to the production subgraph:
5364

5465
2. **Wait for Indexing Completion**
5566
- Monitor the temporary deployment until it's fully synced
56-
67+
5768
3. **Deploy to Production (Zero Downtime)**
5869
- Once temporary deployment is ready, trigger: `subgraph-deploy-prod`
5970
- This swaps the deployments with no service interruption
@@ -108,7 +119,7 @@ query MyQuery($requiredSchema: [String!]!, $start: Int!, $range: Int!) {
108119

109120
1. Update schema.graphql and subgraph.yaml as needed
110121
2. Run codegen to generate TypeScript types: `npm run codegen`
111-
3. Implement mapping handlers in src/ files
122+
3. Implement mapping handlers in src/ files
112123
4. Build the subgraph: `npm run build`
113124
5. Test locally before deploying to production environments
114125

packages/subgraph/networks.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"fuji": {
33
"DataProtector": {
4-
"address": "0x2296daeDD3090750a80fFB2D0147669984909ED2",
5-
"startBlock": 39768073
4+
"address": "0x2296daeDD3090750a80fFB2D0147669984909ED2",
5+
"startBlock": 39768073
66
},
77
"DatasetRegistry": {
88
"address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D",
@@ -23,29 +23,29 @@
2323
},
2424
"arbitrum-sepolia": {
2525
"DataProtector": {
26-
"address": "0x2296daeDD3090750a80fFB2D0147669984909ED2",
27-
"startBlock": 145960686
26+
"address": "0x2296daeDD3090750a80fFB2D0147669984909ED2",
27+
"startBlock": 145960686
2828
},
2929
"DatasetRegistry": {
3030
"address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D",
3131
"startBlock": 145960686
3232
},
3333
"DataProtectorSharing": {
34-
"address": "0x0000000000000000000000000000000000000000",
35-
"startBlock": 0
34+
"address": "0x2485Ed90d4566516298B7D01462df8d1A41E13AE",
35+
"startBlock": 145960686
3636
},
3737
"AppRegistry": {
3838
"address": "0x4a6531ce5150ee716b2d93865D0fbB9ce5492D17",
39-
"startBlock": 0
39+
"startBlock": 145960686
4040
},
4141
"AddOnlyAppWhitelistRegistry": {
42-
"address": "0x0000000000000000000000000000000000000000",
43-
"startBlock": 0
42+
"address": "0x9902e2F89DCC4dcCb75805096Ead2e58Fc389b7D",
43+
"startBlock": 145960686
4444
}
4545
},
4646
"bellecour": {
4747
"DataProtector": {
48-
"address": "0x3a4Ab33F3D605e75b6D00A32A0Fa55C3628F6A59",
48+
"address": "0x3a4Ab33F3D605e75b6D00A32A0Fa55C3628F6A59",
4949
"startBlock": 25455501
5050
},
5151
"DatasetRegistry": {

packages/subgraph/package-lock.json

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)