From 777628e9ca193d15c095e979c219bde6905a9a39 Mon Sep 17 00:00:00 2001 From: rossneilson Date: Mon, 11 Apr 2022 11:03:21 +0100 Subject: [PATCH 1/2] feat: Adding beta preview build --- .github/workflows/preview-build.yml | 1 + .github/workflows/preview-deploy.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 440a0c7122..b42f97769d 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -6,6 +6,7 @@ on: branches: - master - develop + - v1.1-beta pull_request: types: [opened, synchronize, reopened] diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml index 27c0494b5f..14eec1c98d 100644 --- a/.github/workflows/preview-deploy.yml +++ b/.github/workflows/preview-deploy.yml @@ -53,6 +53,12 @@ jobs: CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} if: steps.source-run-info.outputs.sourceHeadRepo == 'DXgovernance/dxvote' && steps.source-run-info.outputs.sourceHeadBranch == 'develop' + - name: Update DNS record for 1.1 beta branch + run: npx dnslink-cloudflare --domain dxvote.dev --record _dnslink.beta --link /ipfs/${{ steps.web3.outputs.cid }} + env: + CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + if: steps.source-run-info.outputs.sourceHeadRepo == 'DXgovernance/dxvote' && steps.source-run-info.outputs.sourceHeadBranch == 'v1.1-beta' + - name: Update DNS record for Master branch run: npx dnslink-cloudflare --domain dxvote.dev --record _dnslink --link /ipfs/${{ steps.web3.outputs.cid }} env: From e7fd3ee9ec769f77f42e92101a45e4a0df349317 Mon Sep 17 00:00:00 2001 From: rossneilson Date: Tue, 10 May 2022 20:58:01 +0100 Subject: [PATCH 2/2] feat: Add pinata pro gateway and key --- src/services/IPFSService.ts | 10 ++++++++-- src/services/PinataService.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/services/IPFSService.ts b/src/services/IPFSService.ts index d5bcff1bd1..d1c4103c31 100644 --- a/src/services/IPFSService.ts +++ b/src/services/IPFSService.ts @@ -50,6 +50,10 @@ export default class IPFSService { async getContentFromIPFS(hash: string) { const response = await Promise.any([ + axios.request({ + url: 'https://dxgov.mypinata.cloud/' + hash, + method: 'GET', + }), axios.request({ url: 'https://ipfs.io/ipfs/' + hash, method: 'GET', @@ -95,8 +99,10 @@ export default class IPFSService { localStorage.setItem('dxvote-newProposal-hash', hash); if (pinataService.auth) { - const pinataPin = await this.pin(hash); + const pinataPin = await pinataService.pin(hash); console.debug('[PINATA PIN]', pinataPin.toString()); + } else { + console.debug('[PINATA PIN] NOT AUTHENTICATED'); } const ipfsPin = await this.pin(hash); console.debug('[IPFS PIN]', ipfsPin); @@ -115,7 +121,7 @@ export default class IPFSService { const hash = await this.add(content); if (this.context.pinataService.auth) { - const pinataPin = await this.pin(hash); + const pinataPin = await this.context.pinataService.pin(hash); console.debug('[PINATA PIN]', pinataPin.toString()); } const ipfsPin = await this.pin(hash); diff --git a/src/services/PinataService.ts b/src/services/PinataService.ts index 3624d98321..9a09b2ca77 100644 --- a/src/services/PinataService.ts +++ b/src/services/PinataService.ts @@ -10,7 +10,7 @@ export default class PinataService { this.context = context; } defaultApiKey = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySW5mb3JtYXRpb24iOnsiaWQiOiI4ZTNlZjUzNi0wZWQ5LTQ4YzAtOTFlYS1kNzUwYjk0Nzk4ZDMiLCJlbWFpbCI6Im1lQHJvc3NuZWlsc29uLmRldiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJwaW5fcG9saWN5Ijp7InJlZ2lvbnMiOlt7ImlkIjoiRlJBMSIsImRlc2lyZWRSZXBsaWNhdGlvbkNvdW50IjoxfV0sInZlcnNpb24iOjF9LCJtZmFfZW5hYmxlZCI6ZmFsc2V9LCJhdXRoZW50aWNhdGlvblR5cGUiOiJzY29wZWRLZXkiLCJzY29wZWRLZXlLZXkiOiJlNmM5ZDA4ZGY3ODY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