From 77bc9a999ccd75efb61ae075325c3072df270f83 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Thu, 23 Mar 2023 16:18:03 +0000 Subject: [PATCH 1/6] ci: fix deploy staging/production subgraph --- .github/workflows/deploy-prod-subgraph.yaml | 10 ++++++++++ .github/workflows/deploy-staging-subgraph.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/deploy-prod-subgraph.yaml b/.github/workflows/deploy-prod-subgraph.yaml index 0ff14cca6..2c74ebb70 100644 --- a/.github/workflows/deploy-prod-subgraph.yaml +++ b/.github/workflows/deploy-prod-subgraph.yaml @@ -22,7 +22,17 @@ jobs: with: node-version: "16" cache: "npm" + - name: Turbo Cache + id: turbo-cache + uses: actions/cache@v3 + with: + path: .turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }} - run: npm ci + - id: build + run: npm run build -- --cache-dir=".turbo" - name: Authenticate The Graph CLI run: npx graph auth --product hosted-service ${{ secrets.THE_GRAPH_ACCESS_TOKEN_PRODUCTION }} - name: Deploy subgraph diff --git a/.github/workflows/deploy-staging-subgraph.yaml b/.github/workflows/deploy-staging-subgraph.yaml index e8db08daf..b7c1f0f01 100644 --- a/.github/workflows/deploy-staging-subgraph.yaml +++ b/.github/workflows/deploy-staging-subgraph.yaml @@ -15,7 +15,17 @@ jobs: with: node-version: "16" cache: "npm" + - name: Turbo Cache + id: turbo-cache + uses: actions/cache@v3 + with: + path: .turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }} - run: npm ci + - id: build + run: npm run build -- --cache-dir=".turbo" - name: Authenticate The Graph CLI run: npx graph auth --product hosted-service ${{ secrets.THE_GRAPH_ACCESS_TOKEN_STAGING }} - name: Deploy subgraph From dcc267aae8d70a9ec7c2fa9b93b4cfcfc03f2f59 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Thu, 23 Mar 2023 12:11:19 +0000 Subject: [PATCH 2/6] chore: add create-offer-batch script (#464) --- package.json | 1 + scripts/create-offer-batch.ts | 82 +++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 scripts/create-offer-batch.ts diff --git a/package.json b/package.json index f5d1ff596..4395a5ed5 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "ipfs-upload": "ts-node -P tsconfig.base.json ./scripts/upload-to-ipfs.ts", "explore-offer": "ts-node -P tsconfig.base.json ./scripts/explore-offer.ts", "create-offer": "ts-node -P tsconfig.base.json ./scripts/create-offer.ts", + "create-offer-batch": "ts-node -P tsconfig.base.json ./scripts/create-offer-batch.ts", "create-seller": "ts-node -P tsconfig.base.json ./scripts/create-seller.ts", "update-seller": "ts-node -P tsconfig.base.json ./scripts/update-seller.ts", "abi-signatures": "ts-node -P tsconfig.base.json ./scripts/abi-signatures.ts", diff --git a/scripts/create-offer-batch.ts b/scripts/create-offer-batch.ts new file mode 100644 index 000000000..d411a3f76 --- /dev/null +++ b/scripts/create-offer-batch.ts @@ -0,0 +1,82 @@ +import fs from "fs"; +import { EnvironmentType } from "@bosonprotocol/common/src/types/configs"; +import { providers, Wallet } from "ethers"; +import { program } from "commander"; +import { getDefaultConfig } from "@bosonprotocol/common/src"; +import { CoreSDK } from "../packages/core-sdk/src"; +import { EthersAdapter } from "../packages/ethers-sdk/src"; + +program + .description("Create Offers (batch).") + .argument( + "", + "Private key of the Seller account (assistant role)." + ) + .argument("", "JSON file with the Offers specific parameters") + .option("-e, --env ", "Target environment", "testing") + .option( + "--template