@@ -24,24 +24,30 @@ 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
40-
41- We use CI/CD pipelines to deploy our subgraphs to hosted environments.
44+ ``` bash
45+ npm run deploy-studio
46+ ```
4247
4348### Self-Hosted Subgraph Deployment Process
4449
50+ We use CI/CD pipelines to deploy our subgraphs to hosted environments.
4551For zero-downtime updates to the production subgraph:
4652
47531 . ** Index the New Version (Temporary Deployment)**
@@ -59,7 +65,7 @@ For zero-downtime updates to the production subgraph:
5965 - This swaps the deployments with no service interruption
6066
61674 . ** Verify the Deployment**
62- - Access the production subgraph at: https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2/graphql
68+ - Access the production subgraph at: < https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2/graphql >
6369
6470## Query Examples
6571
@@ -108,14 +114,14 @@ query MyQuery($requiredSchema: [String!]!, $start: Int!, $range: Int!) {
108114
1091151 . Update schema.graphql and subgraph.yaml as needed
1101162 . Run codegen to generate TypeScript types: ` npm run codegen `
111- 3 . Implement mapping handlers in src/ files
117+ 3 . Implement mapping handlers in ` src/ ` files
1121184 . Build the subgraph: ` npm run build `
1131195 . Test locally before deploying to production environments
114120
115121## CI/CD Integration
116122
117123Our repository uses automated workflows to build, test, and deploy the subgraph:
118124
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
125+ - ** ABI Validation ** : Ensures contract ABIs are up-to-date across all packages
126+ - ** Testing ** : Unit and integration tests validate subgraph functionality (TODO)
127+ - ** Zero-Downtime Deployment** : Staged deployment process ensures continuous service availability
0 commit comments