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

Support Cronos #13

Merged
merged 4 commits into from
Nov 16, 2023
Merged
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
9 changes: 5 additions & 4 deletions .github/workflows/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GHB_TOKEN }}
- name: Lint
run: npm run lint
- name: Build Goerli
run: npm run build:goerli
- name: Test
run: npm run test
- name: Build Mumbai
run: npm run build:mumbai
- name: Build Cronos
run: npm run build:cronos-mainnet
- name: Build Polygon
run: npm run build:polygon
- name: Test
run: npm run test

8 changes: 4 additions & 4 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
run: npm run lint
- name: Subgraph Auth
run: yarn graph:auth -- ${{ secrets.THEGRAPH_API_KEY }}
- name: Build Goerli
run: npm run build:goerli
- name: Deploy Goerli Hosted Service
run: npm run deploy:goerli
- name: Build Mumbai
run: npm run build:mumbai
- name: Deploy Mumbai Hosted Service
run: npm run deploy:mumbai
- name: Build Cronos
run: npm run build:cronos-mainnet
- name: Deploy Self-hosted Cronos
run: npx graph deploy --node ${{ secrets.SELF_HOSTED_SUBGRAPH_URL }} --version-label ${{ github.sha }} cronos-mainnet_prod_nft-roles
- name: Build Polygon
run: npm run build:polygon
- name: Test
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GHB_TOKEN }}
- name: Lint
run: npm run lint
- name: Build Goerli
run: npm run build:goerli
- name: Test
run: npm run test
- name: Build Mumbai
run: npm run build:mumbai
- name: Build Cronos
run: npm run build:cronos-mainnet
- name: Deploy Self-hosted Cronos QA
run: npx graph deploy --node ${{ secrets.SELF_HOSTED_SUBGRAPH_URL }} --version-label qa cronos-mainnet_qa_nft-roles
- name: Build Polygon
run: npm run build:polygon
- name: Test
run: npm run test
- name: Delete Satsuma Polygon QA
run: |
curl -X DELETE https://subgraphs.alchemy.com/api/subgraphs/8c268d3e8b83112a7d0c732a9b88ba1c732da600bffaf68790171b9a0b5d5394/polygon-roles-registry/qa/delete -H 'x-api-key: ${{ secrets.SATSUMA_DEPLOY_KEY }}'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ Get started by installing dependencies, building the project and running the tes

```shell
npm ci
npm run build:goerli
npm run build:mumbai
npm test
```

## Build Project

Building subgraphs consist in generating the code and building the project against a manifest file. This repository
provides a subgraph manifest for each network supported. You can build the project for **Goerli** with the following
provides a subgraph manifest for each network supported. You can build the project for **Mumbai** with the following
command:

```shell
cp subgraph-goerli.yaml subgraph.yaml && graph codegen subgraph.yaml
npm run build:mumbai
```
11 changes: 11 additions & 0 deletions config/cronos-mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"isSelfHosted": true,
"network": "cronos-mainnet",
"ERC721": [
{
"name": "BoredCandyCity",
"address": "0xe1049178296ce004996afb16b0816c5a95ac8482",
"startBlock": 5203166
}
]
}
10 changes: 0 additions & 10 deletions config/goerli.json

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
},
"scripts": {
"graph:auth": "graph auth --product hosted-service",
"build:goerli": "node mustache.config.js goerli && graph codegen subgraph.yaml && graph build subgraph.yaml",
"build:mumbai": "node mustache.config.js mumbai && graph codegen subgraph.yaml && graph build subgraph.yaml",
"build:polygon": "node mustache.config.js polygon && graph codegen subgraph.yaml && graph build subgraph.yaml",
"deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ orium-network/nft-roles-goerli",
"build:cronos-mainnet": "node mustache.config.js cronos-mainnet && graph codegen subgraph.yaml && graph build subgraph.yaml",
"deploy:mumbai": "graph deploy --node https://api.thegraph.com/deploy/ orium-network/nft-roles-mumbai",
"deploy:polygon": "graph deploy --node https://api.thegraph.com/deploy/ orium-network/nft-roles-polygon",
"test": "graph test",
"test": "node mustache.config.js polygon && graph codegen subgraph.yaml && graph test",
"coverage": "graph test -- -c",
"lint": "npx eslint src/",
"lint:fix": "npx eslint src/ --fix && npx prettier --write .",
Expand Down
5 changes: 4 additions & 1 deletion subgraph.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ dataSources:
network: {{network}}
source:
abi: ERC7432
{{#isSelfHosted}}
startBlock: 1
{{/isSelfHosted}}
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand All @@ -79,4 +82,4 @@ dataSources:
handler: handleRoleRevoked
- event: RoleApprovalForAll(indexed address,indexed address,bool)
handler: handleRoleApprovalForAll
file: ./src/erc7432/index.ts
file: ./src/erc7432/index.ts