diff --git a/packages/subgraph/README.md b/packages/subgraph/README.md index 01de9d0f7..9800c6b73 100644 --- a/packages/subgraph/README.md +++ b/packages/subgraph/README.md @@ -26,6 +26,17 @@ npm run deploy-local The subgraph will be available at: http://localhost:8000/subgraphs/name/DataProtector/graphql +### Thegraph network + +To deploy this subgraph on Thegraph network: + +1. Update `networks.json` file to use the correct addresses for the correct network. + +2. Authenticate: `npx graph auth ` + +3. Deploy: `npx graph deploy --network ` + + ### Hosted Production Environments We use CI/CD pipelines to deploy our subgraphs to hosted environments. @@ -53,7 +64,7 @@ For zero-downtime updates to the production subgraph: 2. **Wait for Indexing Completion** - Monitor the temporary deployment until it's fully synced - + 3. **Deploy to Production (Zero Downtime)** - Once temporary deployment is ready, trigger: `subgraph-deploy-prod` - This swaps the deployments with no service interruption @@ -108,7 +119,7 @@ query MyQuery($requiredSchema: [String!]!, $start: Int!, $range: Int!) { 1. Update schema.graphql and subgraph.yaml as needed 2. Run codegen to generate TypeScript types: `npm run codegen` -3. Implement mapping handlers in src/ files +3. Implement mapping handlers in src/ files 4. Build the subgraph: `npm run build` 5. Test locally before deploying to production environments diff --git a/packages/subgraph/networks.json b/packages/subgraph/networks.json index dfafe3fb4..7e69d5538 100644 --- a/packages/subgraph/networks.json +++ b/packages/subgraph/networks.json @@ -1,8 +1,8 @@ { "fuji": { "DataProtector": { - "address": "0x2296daeDD3090750a80fFB2D0147669984909ED2", - "startBlock": 39768073 + "address": "0x2296daeDD3090750a80fFB2D0147669984909ED2", + "startBlock": 39768073 }, "DatasetRegistry": { "address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D", @@ -23,29 +23,29 @@ }, "arbitrum-sepolia": { "DataProtector": { - "address": "0x2296daeDD3090750a80fFB2D0147669984909ED2", - "startBlock": 145960686 + "address": "0x2296daeDD3090750a80fFB2D0147669984909ED2", + "startBlock": 145960686 }, "DatasetRegistry": { "address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D", "startBlock": 145960686 }, "DataProtectorSharing": { - "address": "0x0000000000000000000000000000000000000000", - "startBlock": 0 + "address": "0x2485Ed90d4566516298B7D01462df8d1A41E13AE", + "startBlock": 145960686 }, "AppRegistry": { "address": "0x4a6531ce5150ee716b2d93865D0fbB9ce5492D17", - "startBlock": 0 + "startBlock": 145960686 }, "AddOnlyAppWhitelistRegistry": { - "address": "0x0000000000000000000000000000000000000000", - "startBlock": 0 + "address": "0x9902e2F89DCC4dcCb75805096Ead2e58Fc389b7D", + "startBlock": 145960686 } }, "bellecour": { "DataProtector": { - "address": "0x3a4Ab33F3D605e75b6D00A32A0Fa55C3628F6A59", + "address": "0x3a4Ab33F3D605e75b6D00A32A0Fa55C3628F6A59", "startBlock": 25455501 }, "DatasetRegistry": { diff --git a/packages/subgraph/package-lock.json b/packages/subgraph/package-lock.json index 7fbde9ade..c65192a30 100644 --- a/packages/subgraph/package-lock.json +++ b/packages/subgraph/package-lock.json @@ -1038,10 +1038,13 @@ } }, "node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "license": "MIT" + "version": "22.15.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.18.tgz", + "integrity": "sha512-v1DKRfUdyW+jJhZNEI1PYy29S2YRxMV5AOO/x/SjKmW0acCIOqmbj6Haf9eHAhsPmrhlHSxEhv/1WszcLWV4cg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/@types/parse-json": { "version": "4.0.2", @@ -3280,6 +3283,12 @@ "node": ">=8" } }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "license": "MIT" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4778,6 +4787,12 @@ "node": ">=20.18.1" } }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",