Skip to content

Commit 2b26d3c

Browse files
committed
feat(subgraph): add redact shield native
1 parent 93fc585 commit 2b26d3c

18 files changed

Lines changed: 1127 additions & 42 deletions

.github/workflows/subgraph.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ jobs:
2626
- name: Install dependencies
2727
run: pnpm install --frozen-lockfile
2828

29-
- name: Codegen and build
29+
- name: Codegen and build (mainnet)
3030
run: |-
31-
pnpm run codegen
32-
pnpm run build
31+
pnpm run codegen:mainnet
32+
pnpm run build:mainnet
33+
working-directory: subgraph
34+
35+
- name: Codegen and build (sepolia)
36+
run: |-
37+
pnpm run codegen:sepolia
38+
pnpm run build:sepolia
3339
working-directory: subgraph
3440

3541
- name: Test

pnpm-lock.yaml

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

subgraph/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Subgraph
2+
3+
Build the required subgraph to fetch metrics data for the benchmarks.
4+
5+
# Build and deploy
6+
7+
```bash
8+
# 0. merge the schema files into a single one
9+
# happens automatically because of hook "precodegen" in package.json
10+
# 1. generate the code types for the subgraph
11+
NETWORK=mainnet pnpm run codegen
12+
NETWORK=sepolia pnpm run codegen
13+
14+
15+
# 2. build the subgraph
16+
NETWORK=mainnet pnpm run build
17+
NETWORK=sepolia pnpm run build
18+
19+
# 3. Authenticate graph CLI
20+
graph auth <DEPLOY_KEY_DIFFERENT_FROM_API_KEY>
21+
22+
# 4. deploy the subgraph to The Graph Studio
23+
NETWORK=mainnet pnpm run deploy
24+
NETWORK=sepolia pnpm run deploy
25+
26+
# On Windows use:
27+
$env:NETWORK="<NETWORK_NAME>"; pnpm run <COMMAND>
28+
```
29+
30+
**Note**: A subgraph can only point to one network at the time. We need multiple subgraph.yaml files for each network. More info [here](https://thegraph.com/docs/en/subgraphs/developing/creating/subgraph-manifest/#subgraph-capabilities).
31+
32+
# Test prerequisites
33+
34+
`graph test` uses Matchstick. On Linux, the Matchstick binary depends on the PostgreSQL client shared library `libpq.so.5`.
35+
36+
Install it before running tests:
37+
38+
```bash
39+
sudo apt install postgresql
40+
# or, if you only want the runtime library
41+
sudo apt install libpq5
42+
```
43+
44+
## Running tests
45+
46+
Unit tests live in `tests/` and run against a minimal dummy `subgraph.yaml`.
47+
48+
```bash
49+
# Or run all tests
50+
pnpm run test
51+
```
File renamed without changes.

0 commit comments

Comments
 (0)