You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-40Lines changed: 64 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,11 @@
1
-
# iExec PoCo v5 - subgraph
1
+
# iExec PoCo Subgraph
2
2
3
-
A subgraph to explore the PoCo smarcontracts
3
+
A subgraph to index the PoCo Smart Contracts.
4
4
5
-
[CHANGELOG](./CHANGELOG.md)
6
5
7
-
#Setup coverage
6
+
## Local development
8
7
9
-
> In order for Matchstick to check which handlers are being run, those handlers need to be exported from the test file.
10
-
11
-
Check how to export handlers with [Matchstick - Test Coverage documentation](https://thegraph.com/docs/en/subgraphs/developing/creating/unit-testing-framework/#test-coverage).
12
-
13
-
> [!NOTE]
14
-
> Since Matchstick code coverage is in very early stages, Matchstick cannot check for branch coverage, but rely on the assertion that a given handler has been called.
15
-
16
-
## local dev
17
-
18
-
run local services:
8
+
Run local services:
19
9
20
10
- blockchain with iExec PoCo deployed
21
11
- graph node (with ipfs + DB)
@@ -24,49 +14,91 @@ run local services:
24
14
docker-compose -f docker/test/docker-compose.yml up -d
25
15
```
26
16
27
-
install project deps
17
+
Install project dependencies
28
18
29
19
```sh
30
20
npm ci
31
21
```
32
22
33
-
build the project and generate the necessary files:
23
+
Build the project and generate the necessary files:
34
24
35
25
```sh
36
26
npm run build
37
27
```
38
28
39
-
deploy the subgraph on local node
29
+
Deploy the subgraph on local node
40
30
41
31
```sh
42
32
npm run start-test-stack
43
33
```
44
34
45
-
run integration tests
35
+
Run integration tests
46
36
47
37
```sh
48
38
npm run itest
49
39
```
50
40
51
-
test/poco subgraph graphql API enpoints:
52
-
41
+
The subgraph `test/poco` graphql API is accessible at:
Here's the revised "Generating Subgraph and Jenkins Configuration Files" section for your README:
45
+
### Coverage setup
46
+
47
+
> In order for Matchstick to check which handlers are being run, those handlers need to be exported from the test file.
48
+
49
+
Check how to export handlers with [Matchstick - Test Coverage documentation](https://thegraph.com/docs/en/subgraphs/developing/creating/unit-testing-framework/#test-coverage).
50
+
51
+
> [!NOTE]
52
+
> Since Matchstick code coverage is in very early stages, Matchstick cannot check for branch coverage, but rely on the assertion that a given handler has been called.
53
+
54
+
## Deployment Options
55
+
56
+
### Thegraph network
57
+
58
+
#### CI/CD deployment (recommended)
59
+
60
+
The recommended approach to deploy the subgraph on The Graph network is to use
61
+
the dedicated Github Actions workflow:
62
+
63
+
1. Set up the Github environment for the target network (e.g. `arbitrum`) with
64
+
the required environnment variables and secrets:
65
+
- `vars.SUBGRAPH_SLUG`
66
+
- `secrets.SUBGRAPH_DEPLOY_KEY`
67
+
- `vars.SUBGRAPH_NETWORK_NAME`
68
+
- `VERSION_LABEL` is a workfow input
69
+
70
+
2. Trigger the deployment Action on Github and specify the `version_label` input.
71
+
72
+
#### Manual deployment
58
73
59
-
## Docker subgraph deployer
74
+
To deploy this subgraph on Thegraph network manually:
60
75
61
-
docker image for deploying the subgraph
76
+
1. Set up environment variables in `.env` file:
62
77
63
-
### Build Image
78
+
```bash
79
+
SUBGRAPH_SLUG=<subgraph-slug>
80
+
SUBGRAPH_DEPLOY_KEY=<deploy-key>
81
+
SUBGRAPH_NETWORK_NAME=<network-name>
82
+
VERSION_LABEL=<version-label>
83
+
```
84
+
85
+
2. Deploy using the npm script:
86
+
87
+
```bash
88
+
npm run deploy-studio
89
+
```
90
+
91
+
### Self-hosted subgraph deployment
92
+
93
+
The subgraph is deployed via a generated Docker image.
The subgraph can be deployed using Github Actions (recommended). The dedicated job can be triggered with the desired configuration (environment, version, ...).
88
120
89
-
The project uses a Jenkins pipeline for automated deployment of the subgraph. The deployment can be triggered through Jenkins with interactive parameter selection.
121
+
### Deployment configuration
90
122
91
123
#### Available Parameters
92
124
@@ -129,21 +161,13 @@ To add support for a new network, update the `networks.json` file with the netwo
129
161
}
130
162
```
131
163
132
-
Also, update the Jenkins pipeline choices to include the new network:
133
-
134
-
```groovy
135
-
choice(
136
-
name: 'networkName',
137
-
choices: ['bellecour', 'new-network'],
138
-
description: 'Select the target network'
139
-
)
140
-
```
164
+
## Changelog
141
165
142
-
The deployment process will automatically generate the appropriate subgraph configuration using the network-specific addresses and start blocks from `networks.json`.
166
+
Changes to this project are tracked in [CHANGELOG.md](./CHANGELOG.md)
0 commit comments