Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: subgraph deployment instruction #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,22 @@ See https://github.com/nation3/agreements-app
## Documentation

https://github.com/nation3/agreements-app/blob/main/README.md#documentation

## How to deploy/redeploy subgraph
Update `networks.json` file before deploying subgraph
aahna-ashina marked this conversation as resolved.
Show resolved Hide resolved

#### Mainnet
```
yarn auth
yarn codegen
yarn build-mainnet
Comment on lines +18 to +20
Copy link
Member

@aahna-ashina aahna-ashina Mar 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to also add these 3 steps to a GitHub workflow? - https://github.com/nation3/agreements-contracts/tree/main/.github/workflows

(Excluding yarn deploy-mainnet)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can, but it's useless since yarn auth needs an access token from Subgraph. I don't think we should publish this token and yarn codegen just creates a schema.ts file.

yarn deploy-mainnet
```

#### Sepolia
```
yarn auth
yarn codegen
yarn build-sepolia
yarn deploy-sepolia
```
20 changes: 16 additions & 4 deletions packages/subgraph/networks.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
{
"goerli": {
"AgreementFramework": {
"address": "0x51b024Ca13F6E044df4932431bF8DD0E5d4b81ba"
"mainnet": {
"CollateralAgreementFramework": {
"address": "0x2E41383506A6715da7dd0985dC401fe720e473c0",
"startBlock": 7843026
},
"Arbitrator": {
"address": "0xA723Fc96d9180637B21048168D0344CC677da64c"
"address": "0x1dBEFF62DFa113f7254AaB5772F1AC6E66F94e7e",
"startBlock": 7843026
}
},
"sepolia": {
"CollateralAgreementFramework": {
"address": "0xD96aA6e2568f4e9632D2A5234Bb8410ca7609a27",
"startBlock": 5299529
},
"Arbitrator": {
"address": "0xBe67cEdCD1FE38aac8a5781A51250FDeFB344E6C",
"startBlock": 5299529
}
}
}
11 changes: 7 additions & 4 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
"version": "0.1.0",
"scripts": {
"codegen": "graph codegen",
"build": "graph build",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ nation3/nation3-court-subgraph",
"build-mainnet": "graph build --network mainnet",
"build-sepolia": "graph build --network sepolia",
"auth": "graph auth --product hosted-service b817467290d54bbe945230faa5afa3ac",
"deploy-mainnet": "graph deploy --product hosted-service nation3/nation3-agreements-mainnet",
"deploy-sepolia": "graph deploy --product hosted-service nation3/nation3-agreements-sepolia",
"create-local": "graph create --node http://localhost:8020/ nation3/nation3-court-subgraph",
"remove-local": "graph remove --node http://localhost:8020/ nation3/nation3-court-subgraph",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 nation3/nation3-court-subgraph",
"test": "graph test"
},
"dependencies": {
"@graphprotocol/graph-cli": "^0.33.1",
"@graphprotocol/graph-ts": "0.27.0"
"@graphprotocol/graph-cli": "^0.68.4",
"@graphprotocol/graph-ts": "^0.33.0"
},
"devDependencies": {
"matchstick-as": "^0.5.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/subgraph/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ schema:
dataSources:
- kind: ethereum
name: CollateralAgreementFramework
network: mainnet
network: sepolia
source:
# address: "0x710617547D96573520b5f38668168DaFDBD9EA83"
address: "0x2E41383506A6715da7dd0985dC401fe720e473c0"
abi: AgreementFramework
startBlock: 7843026
address: "0xD96aA6e2568f4e9632D2A5234Bb8410ca7609a27"
startBlock: 5299529
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand All @@ -37,11 +36,11 @@ dataSources:
file: ./src/agreement-framework.ts
- kind: ethereum
name: Arbitrator
network: mainnet
network: sepolia
source:
address: "0x1dBEFF62DFa113f7254AaB5772F1AC6E66F94e7e"
abi: Arbitrator
startBlock: 7843026
address: "0xBe67cEdCD1FE38aac8a5781A51250FDeFB344E6C"
startBlock: 5299529
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand All @@ -53,7 +52,8 @@ dataSources:
- name: Arbitrator
file: ./abis/IArbitrator.json
eventHandlers:
- event: ResolutionSubmitted(indexed address,indexed bytes32,indexed bytes32,bytes32)
- event: ResolutionSubmitted(indexed address,indexed bytes32,indexed
bytes32,bytes32)
handler: handleResolutionSubmitted
- event: ResolutionAppealed(indexed bytes32,bytes32,address)
handler: handleResolutionAppealed
Expand Down
Loading
Loading