Skip to content

Commit 658ff0f

Browse files
committed
refactor: both the core and drt subgraphs
1 parent 5060126 commit 658ff0f

39 files changed

+111
-91
lines changed

.github/workflows/deploy-subgraph.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ on:
66
network:
77
description: The network to deploy the subgraph to
88
required: true
9-
default: 'arbitrum-goerli'
9+
default: 'arbitrum-sepolia'
1010
type: choice
1111
options:
12-
- arbitrum-goerli-devnet
13-
- arbitrum-goerli
12+
- arbitrum-sepolia-devnet
13+
- arbitrum-sepolia
1414
- arbitrum
15+
subgraph:
16+
description: The name of the subgraph to deploy
17+
required: true
18+
default: 'core'
19+
type: choice
20+
options:
21+
- core
22+
- drt
1523
update:
1624
description: Whether to update the subgraph with the current artifacts for the selected network.
1725
required: true
@@ -58,19 +66,19 @@ jobs:
5866
if: ${{ inputs.update }}
5967
run: |
6068
export PATH=$PWD/../bin:$PATH
61-
yarn update:${{ inputs.network }}
69+
yarn update:${{ inputs.subgraph }}:${{ inputs.network }}
6270
working-directory: subgraph
6371

6472
- name: Build the subgraph
6573
run: |
66-
yarn codegen
67-
yarn build
74+
yarn codegen:${{ inputs.subgraph }}
75+
yarn build:${{ inputs.subgraph }}
6876
working-directory: subgraph
6977

7078
- name: Authenticate with TheGraph
7179
run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --product hosted-service
7280
working-directory: subgraph
7381

7482
- name: Deploy the subgraph
75-
run: yarn deploy:${{ inputs.network }}
83+
run: yarn deploy:${{ inputs.subgraph }}:${{ inputs.network }}
7684
working-directory: subgraph

subgraph/README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@
22

33
## Deployments
44

5-
### Arbitrum Sepolia (hosted service)
5+
### Testnet
66

7-
- [Subgraph explorer](https://thegraph.com/explorer/subgraph/kleros/kleros-v2-core-arbitrum-sepolia)
8-
- [Subgraph endpoints](https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-arbitrum-sepolia)
7+
- [Core](https://thegraph.com/studio/subgraph/kleros-v2-core-testnet/)
8+
- [Dispute Registry Template - Arbitrum Sepolia](https://thegraph.com/studio/subgraph/kleros-v2-drt-arbisep-testnet/)
9+
10+
### Devnet
11+
12+
- [Core](https://thegraph.com/studio/subgraph/kleros-v2-core-devnet/)
13+
- [Dispute Registry Template - Arbitrum Sepolia](https://thegraph.com/studio/subgraph/kleros-v2-drt-arbisep-devnet/)
14+
- [Dispute Registry Template - Gnosis]()
15+
- [Dispute Registry Template - Sepolia]()
916

1017
## Build
1118

1219
```bash
1320
# update subgraph.yml using the contract deployment artifacts
14-
$ yarn update:arbitrum-sepolia
21+
$ yarn update:arbitrum-sepolia-devnet
1522

1623
$ yarn codegen
1724

1825
$ yarn build
1926
```
2027

21-
## Deployment to The Graph (hosted service)
28+
## Deployment to The Graph Studio
2229

2330
### Using a personal account for development
2431

@@ -27,13 +34,13 @@ $ yarn build
2734
Get an API key from the thegraph.com, then authenticate.
2835

2936
```bash
30-
$ yarn run graph auth --product hosted-service
37+
$ yarn run graph auth --studio
3138
```
3239

3340
#### Deployment
3441

3542
```bash
36-
yarn deploy:arbitrum-sepolia
43+
yarn deploy:arbitrum-sepolia-devnet
3744
```
3845

3946
### Using the Kleros organization account
File renamed without changes.
File renamed without changes.
File renamed without changes.

subgraph/src/HomeGateway.ts renamed to subgraph/core/src/HomeGateway.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import {
2-
HomeGateway,
3-
Dispute as DisputeEvent,
4-
} from "../generated/HomeGateway/HomeGateway";
5-
import {
6-
GatewayDispute
7-
} from "../generated/schema";
1+
import { HomeGateway, Dispute as DisputeEvent } from "../generated/HomeGateway/HomeGateway";
2+
import { GatewayDispute } from "../generated/schema";
83

94
export function handleDisputeEvent(event: DisputeEvent): void {
105
const contract = HomeGateway.bind(event.address);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)