diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a6d8b71..649762d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,4 +13,4 @@ jobs: node-version: 18 - run: npm install - run: npm run codegen - - run: npm run build + - run: npm run build \ No newline at end of file diff --git a/.github/workflows/deploy-moonbeam.yaml b/.github/workflows/deploy-moonbeam.yaml new file mode 100644 index 0000000..e741415 --- /dev/null +++ b/.github/workflows/deploy-moonbeam.yaml @@ -0,0 +1,22 @@ +name: DeployMoonbeam +on: + push: + branches: + - moonbeam + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JS + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install + - run: npm install -g @graphprotocol/graph-cli + - run: npm run codegen + - run: graph auth --product hosted-service ${API_KEY} + env: + API_KEY: ${{ secrets.HP_GRAPH_API_KEY }} + - run: graph deploy --product hosted-service humanprotocol/moonbeam \ No newline at end of file diff --git a/.github/workflows/deploy-rinkeby.yaml b/.github/workflows/deploy-rinkeby.yaml index eb482d2..fcd0baf 100644 --- a/.github/workflows/deploy-rinkeby.yaml +++ b/.github/workflows/deploy-rinkeby.yaml @@ -19,4 +19,4 @@ jobs: - run: graph auth --product hosted-service ${API_KEY} env: API_KEY: ${{ secrets.HP_GRAPH_API_KEY }} - - run: graph deploy --product hosted-service humanprotocol/rinkeby + - run: graph deploy --product hosted-service humanprotocol/rinkeby \ No newline at end of file diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ac0ab76..d9a3932 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -19,4 +19,4 @@ jobs: - run: graph auth --product hosted-service ${API_KEY} env: API_KEY: ${{ secrets.HP_GRAPH_API_KEY }} - - run: graph deploy --product hosted-service humanprotocol/polygon + - run: graph deploy --product hosted-service humanprotocol/polygon \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9d8056f..69d4b34 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ generated/ node_modules/ package-lock.json src/generated +yarn.lock diff --git a/README.md b/README.md index 61824e6..e7ae83d 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,5 @@ Currently deploying to: - main branch -> https://thegraph.com/hosted-service/subgraph/humanprotocol/polygon - rinkeby branch -> https://thegraph.com/hosted-service/subgraph/humanprotocol/rinkeby + +- moonbeam branch -> https://thegraph.com/hosted-service/subgraph/humanprotocol/moonbeam diff --git a/networks.json b/networks.json index 9c4d7c3..2c4327c 100644 --- a/networks.json +++ b/networks.json @@ -1,4 +1,14 @@ { + "mbase": { + "EscrowFactory": { + "address": "0x98108c28B7767a52BE38B4860832dd4e11A7ecad", + "startBlock": 1145429 + }, + "HMToken": { + "address": "0x3b25BC1dC591D24d60560d0135D6750A561D4764 ", + "startBlock": 1105853 + } + }, "matic": { "EscrowFactory": { "address": "0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794", @@ -19,5 +29,4 @@ "startBlock": 7200306 } } - } diff --git a/package.json b/package.json index facf501..81ed4fd 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,9 @@ { - "name": "humansubgraph", + "name": "hmtmoonbeam", "license": "UNLICENSED", "scripts": { "codegen": "graph codegen", - "build": "graph build", - "deploy": "graph deploy --node https://api.thegraph.com/deploy/ posix4e/humansubgraph", - "create-local": "graph create --node http://localhost:8020/ posix4e/humansubgraph", - "remove-local": "graph remove --node http://localhost:8020/ posix4e/humansubgraph", - "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 posix4e/humansubgraph" + "build": "graph build" }, "dependencies": { "@graphprotocol/graph-cli": "0.29.2", diff --git a/src/mapping/escrow.ts b/src/mapping/escrow.ts index 72e2d59..f004a2e 100644 --- a/src/mapping/escrow.ts +++ b/src/mapping/escrow.ts @@ -5,9 +5,9 @@ import { IntermediateStorage, Pending, StoreResultsCall -} from "../generated/templates/Escrow/Escrow" +} from "../../generated/templates/Escrow/Escrow" import { ethereum } from '@graphprotocol/graph-ts' -import { BulkTransferEvent, ISEvent, PEvent} from "../generated/schema" +import { BulkTransferEvent, ISEvent, PEvent} from "../../generated/schema" export function handleIntermediateStorage(event: IntermediateStorage): void { // Entities can be loaded from the store using a string ID; this ID diff --git a/src/mapping/escrowfactory.ts b/src/mapping/escrowfactory.ts index 66efb7f..26e31c9 100644 --- a/src/mapping/escrowfactory.ts +++ b/src/mapping/escrowfactory.ts @@ -2,9 +2,9 @@ import { BigInt } from "@graphprotocol/graph-ts" import { EscrowFactory, Launched -} from "../generated/EscrowFactory/EscrowFactory" -import { EscrowFactory } from "../generated/schema" -import { Escrow } from "../generated/templates" +} from "../../generated/EscrowFactory/EscrowFactory" +import { EscrowFactory } from "../../generated/schema" +import { Escrow } from "../../generated/templates" export function handleLaunched(event: Launched): void { // Entities can be loaded from the store using a string ID; this ID diff --git a/src/mapping/hm-token.ts b/src/mapping/hm-token.ts index 4779b1a..763aefe 100644 --- a/src/mapping/hm-token.ts +++ b/src/mapping/hm-token.ts @@ -5,8 +5,8 @@ import { Transfer, BulkApproval, BulkTransfer, -} from "../generated/HMToken/HMToken"; -import { HMBulkTransferEvent, HMTransferEvent } from "../generated/schema"; +} from "../../generated/HMToken/HMToken"; +import { HMBulkTransferEvent, HMTransferEvent } from "../../generated/schema"; export function handleTransfer(event: Transfer): void { let entity = HMTransferEvent.load( diff --git a/subgraph.yaml b/subgraph.yaml index 56a16e6..2e29a5c 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -1,15 +1,14 @@ specVersion: 0.0.5 -description: Human Polygon, with transactions 1 schema: file: ./schema.graphql dataSources: - kind: ethereum name: EscrowFactory - network: matic + network: moonbeam source: abi: EscrowFactory - address: "0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794" - startBlock: 25426565 + address: "0x98108c28B7767a52BE38B4860832dd4e11A7ecad" + startBlock: 1145429 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -25,11 +24,11 @@ dataSources: handler: handleLaunched - kind: ethereum name: HMToken - network: matic + network: moonbeam source: abi: HMToken - address: "0xc748B2A084F8eFc47E086ccdDD9b7e67aEb571Bf" - startBlock: 20181700 + address: "0x3b25BC1dC591D24d60560d0135D6750A561D4764" + startBlock: 1105853 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -55,7 +54,7 @@ dataSources: templates: - name: Escrow kind: ethereum/contract - network: matic + network: moonbeam source: abi: Escrow mapping: