@@ -24,24 +24,32 @@ npm run create-local
2424npm run deploy-local
2525```
2626
27- The subgraph will be available at: http://localhost:8000/subgraphs/name/DataProtector/graphql
27+ The subgraph will be available at: < http://localhost:8000/subgraphs/name/DataProtector/graphql >
2828
2929### Thegraph network
3030
3131To deploy this subgraph on Thegraph network:
3232
33- 1 . Update ` networks.json ` file to use the correct addresses for the correct network.
33+ 1 . Set up your environment variables in ` .env ` file:
3434
35- 2 . Authenticate: ` npx graph auth <token> `
35+ ``` bash
36+ SUBGRAPH_SLUG=your-subgraph-slug
37+ SUBGRAPH_DEPLOY_KEY=your-deploy-key
38+ SUBGRAPH_NETWORK_NAME=your-network-name
39+ VERSION_LABEL=your-version-label
40+ ```
3641
37- 3 . Deploy: ` npx graph deploy <slug> --network <name> `
42+ 2 . Deploy using the npm script:
3843
39- ### Hosted Production Environments
44+ ``` bash
45+ npm run deploy-studio
46+ ```
4047
41- We use CI/CD pipelines to deploy our subgraphs to hosted environments.
48+ This will run: ` graph deploy ${SUBGRAPH_SLUG} --deploy-key ${SUBGRAPH_DEPLOY_KEY} --network ${SUBGRAPH_NETWORK_NAME} --version-label ${VERSION_LABEL} `
4249
4350### Self-Hosted Subgraph Deployment Process
4451
52+ We use CI/CD pipelines to deploy our subgraphs to hosted environments.
4553For zero-downtime updates to the production subgraph:
4654
47551 . ** Index the New Version (Temporary Deployment)**
@@ -59,7 +67,7 @@ For zero-downtime updates to the production subgraph:
5967 - This swaps the deployments with no service interruption
6068
61694 . ** Verify the Deployment**
62- - Access the production subgraph at: https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2/graphql
70+ - Access the production subgraph at: < https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2/graphql >
6371
6472## Query Examples
6573
@@ -108,14 +116,14 @@ query MyQuery($requiredSchema: [String!]!, $start: Int!, $range: Int!) {
108116
1091171 . Update schema.graphql and subgraph.yaml as needed
1101182 . Run codegen to generate TypeScript types: ` npm run codegen `
111- 3 . Implement mapping handlers in src/ files
119+ 3 . Implement mapping handlers in ` src/ ` files
1121204 . Build the subgraph: ` npm run build `
1131215 . Test locally before deploying to production environments
114122
115123## CI/CD Integration
116124
117125Our repository uses automated workflows to build, test, and deploy the subgraph:
118126
119- - ABI validation checks ensure contract ABIs are up-to-date
120- - Docker images are built and pushed with appropriate tags based on the source branch
121- - Deployment follows a staged approach to ensure zero downtime
127+ - ** ABI Validation ** : Ensures contract ABIs are up-to-date across all packages
128+ - ** Testing ** : Unit and integration tests validate subgraph functionality (TODO)
129+ - ** Zero-Downtime Deployment** : Staged deployment process ensures continuous service availability
0 commit comments