From 636bcae9b73c25ceafde67e4d93894a58d75f088 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 20:01:58 +0300 Subject: [PATCH 01/31] test deployment --- .github/workflows/gcr_push_workflow.yml | 28 ++++++++++++++++++++++++- .github/workflows/push_test.yml | 16 ++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/push_test.yml diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index b14e7efd..64084b11 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -17,7 +17,7 @@ on: required: true jobs: - deploy: + build: name: Build tag and push docker images to GCR. runs-on: ubuntu-latest steps: @@ -42,6 +42,14 @@ jobs: docker push ${{ inputs.image_name }}:${{ github.ref_name }} docker push ${{ inputs.image_name }} + - name: Build and push images to GCR, with tag latest and git tag. + if: ${{ inputs.branch_name == 'refs/heads/guy/master/dev_helm_deploymentt' }} + run: | + docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing + docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }} + docker push ${{ inputs.image_name }}:${{ github.ref_name }} + docker push ${{ inputs.image_name }} + - name: Build with production env and push with mainnet and stable tags. if: ${{ inputs.branch_name == 'refs/heads/master' }} run: | @@ -58,3 +66,21 @@ jobs: docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }}-goerli docker push ${{ inputs.image_name }}:${{ github.ref_name }}-goerli + + deploy: + if: ${{ inputs.branch_name == 'refs/heads/guy/master/dev_helm_deployment' }} + name: Deploy dev env using helm upgrade + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup GKE cluster + uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e + with: + cluster_name: web-devs + location: us-central1 + credentials: ${{ secrets.gcp_token }} + - name: Show directory + run: | + ls + kubectl get ns diff --git a/.github/workflows/push_test.yml b/.github/workflows/push_test.yml new file mode 100644 index 00000000..eaa9dc3d --- /dev/null +++ b/.github/workflows/push_test.yml @@ -0,0 +1,16 @@ +name: Docker build tag and push frontend images to GCR workflow. + +on: + push: + tags: + - t*.*.* + +jobs: + push-frontend-image: + uses: ./.github/workflows/gcr_push_workflow.yml + with: + image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend + branch_name: ${{ github.event.base_ref }} + dockerfile: Dockerfile.frontend + secrets: + gcp_token: ${{ secrets.STARKGATE_SA }} From 801b56f6d1bac98c78e4955b9cc61ef5ae9a079a Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 22:11:59 +0300 Subject: [PATCH 02/31] Test workflow --- .github/workflows/gcr_push_workflow.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 64084b11..0990cbfd 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -43,7 +43,7 @@ jobs: docker push ${{ inputs.image_name }} - name: Build and push images to GCR, with tag latest and git tag. - if: ${{ inputs.branch_name == 'refs/heads/guy/master/dev_helm_deploymentt' }} + if: ${{ inputs.branch_name == 'refs/heads/guy/master/dev_helm_deployment' }} run: | docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }} @@ -84,3 +84,15 @@ jobs: run: | ls kubectl get ns + - name: Deploy dev enc using helm upgrade + uses: WyriHaximus/github-action-helm3@v2 + with: + exec: | + helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz + helm repo add starkware s3://starkware-third-party/helm-repo/charts + helm repo update + helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet-guy \ + --values deployment/development.yml \ + --set-file configMap.frontend.envs=.env.testing \ + --set frontend.image.tag=${{ github.ref_name }} + kubeconfig: '${{ secrets.KUBECONFIG }}' From e66930bafc7f21de54f339d89ea6506694f35abd Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 22:21:35 +0300 Subject: [PATCH 03/31] Install s3 repo --- .github/workflows/gcr_push_workflow.yml | 23 +++++++++-------------- .github/workflows/push_test.yml | 2 -- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 0990cbfd..07084767 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -80,19 +80,14 @@ jobs: cluster_name: web-devs location: us-central1 credentials: ${{ secrets.gcp_token }} + - name: Helm tool installer + uses: Azure/setup-helm@v2.0 - name: Show directory run: | - ls - kubectl get ns - - name: Deploy dev enc using helm upgrade - uses: WyriHaximus/github-action-helm3@v2 - with: - exec: | - helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz - helm repo add starkware s3://starkware-third-party/helm-repo/charts - helm repo update - helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet-guy \ - --values deployment/development.yml \ - --set-file configMap.frontend.envs=.env.testing \ - --set frontend.image.tag=${{ github.ref_name }} - kubeconfig: '${{ secrets.KUBECONFIG }}' + helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz + helm repo add starkware s3://starkware-third-party/helm-repo/charts + helm repo update + helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet-guy \ + --values deployment/development.yml \ + --set-file configMap.frontend.envs=.env.testing \ + --set frontend.image.tag=${{ github.ref_name }} diff --git a/.github/workflows/push_test.yml b/.github/workflows/push_test.yml index eaa9dc3d..7a50c1b1 100644 --- a/.github/workflows/push_test.yml +++ b/.github/workflows/push_test.yml @@ -2,8 +2,6 @@ name: Docker build tag and push frontend images to GCR workflow. on: push: - tags: - - t*.*.* jobs: push-frontend-image: From 882ad01c5d8a8418c6997c9416ddaff3ed779ce1 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 22:25:51 +0300 Subject: [PATCH 04/31] Install s3 repo --- .github/workflows/push_test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push_test.yml b/.github/workflows/push_test.yml index 7a50c1b1..6b4395bb 100644 --- a/.github/workflows/push_test.yml +++ b/.github/workflows/push_test.yml @@ -2,6 +2,8 @@ name: Docker build tag and push frontend images to GCR workflow. on: push: + branches: + - guy/master/dev_helm_deployment jobs: push-frontend-image: From cf5e3fdbd1f82e5cf0d158ff569e1fb021ad6db8 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 22:26:30 +0300 Subject: [PATCH 05/31] Install s3 repo --- .github/workflows/push_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_test.yml b/.github/workflows/push_test.yml index 6b4395bb..eaa9dc3d 100644 --- a/.github/workflows/push_test.yml +++ b/.github/workflows/push_test.yml @@ -2,8 +2,8 @@ name: Docker build tag and push frontend images to GCR workflow. on: push: - branches: - - guy/master/dev_helm_deployment + tags: + - t*.*.* jobs: push-frontend-image: From f3a616563f55d7e198ccb9282721bf6eefe95bff Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 22:54:13 +0300 Subject: [PATCH 06/31] Add aws auth --- .github/workflows/gcr_push_workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 07084767..73ed3c04 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -82,6 +82,11 @@ jobs: credentials: ${{ secrets.gcp_token }} - name: Helm tool installer uses: Azure/setup-helm@v2.0 + - name: Configure AWS credentials from Test account + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::732425397060:role/repo-3s-upload + aws-region: us-east-2 - name: Show directory run: | helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz From 5fd73b6cdd2f3e874c429a6e0834505083676632 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Mon, 4 Apr 2022 23:13:17 +0300 Subject: [PATCH 07/31] Add auth to aws --- .github/workflows/gcr_push_workflow.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 73ed3c04..4814de56 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -88,6 +88,10 @@ jobs: role-to-assume: arn:aws:iam::732425397060:role/repo-3s-upload aws-region: us-east-2 - name: Show directory + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-2 run: | helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz helm repo add starkware s3://starkware-third-party/helm-repo/charts From fa430663f5ff3a7919a742045d90c7e1ccc7eb16 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 5 Apr 2022 18:41:14 +0300 Subject: [PATCH 08/31] Delete Aws arn --- .github/workflows/gcr_push_workflow.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 4814de56..48978813 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -82,11 +82,6 @@ jobs: credentials: ${{ secrets.gcp_token }} - name: Helm tool installer uses: Azure/setup-helm@v2.0 - - name: Configure AWS credentials from Test account - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: arn:aws:iam::732425397060:role/repo-3s-upload - aws-region: us-east-2 - name: Show directory env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From cf210c9e5d5042981de6e3e1bfcf27e77795081d Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 5 Apr 2022 19:40:56 +0300 Subject: [PATCH 09/31] Update aws access and secret keys --- .github/workflows/push_test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push_test.yml b/.github/workflows/push_test.yml index eaa9dc3d..5da8ec84 100644 --- a/.github/workflows/push_test.yml +++ b/.github/workflows/push_test.yml @@ -14,3 +14,5 @@ jobs: dockerfile: Dockerfile.frontend secrets: gcp_token: ${{ secrets.STARKGATE_SA }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 8f93ccac87b6d0e9aeb0cec303324cf61c7f8f74 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 5 Apr 2022 19:42:55 +0300 Subject: [PATCH 10/31] Add AWS_SECRET_ACCESS_KEY to gcp workflow --- .github/workflows/gcr_push_workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 48978813..ce1d6485 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -15,7 +15,10 @@ on: secrets: gcp_token: required: true - + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true jobs: build: name: Build tag and push docker images to GCR. From 896a577cbb825e29077d727336e6983a9d6dbe35 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 5 Apr 2022 19:49:50 +0300 Subject: [PATCH 11/31] Delete testing --- .github/workflows/gcr_push_workflow.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index ce1d6485..2f043b05 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -45,14 +45,6 @@ jobs: docker push ${{ inputs.image_name }}:${{ github.ref_name }} docker push ${{ inputs.image_name }} - - name: Build and push images to GCR, with tag latest and git tag. - if: ${{ inputs.branch_name == 'refs/heads/guy/master/dev_helm_deployment' }} - run: | - docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing - docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }} - docker push ${{ inputs.image_name }}:${{ github.ref_name }} - docker push ${{ inputs.image_name }} - - name: Build with production env and push with mainnet and stable tags. if: ${{ inputs.branch_name == 'refs/heads/master' }} run: | @@ -71,8 +63,9 @@ jobs: docker push ${{ inputs.image_name }}:${{ github.ref_name }}-goerli deploy: - if: ${{ inputs.branch_name == 'refs/heads/guy/master/dev_helm_deployment' }} - name: Deploy dev env using helm upgrade + if: ${{ inputs.branch_name == 'refs/heads/dev' }} + name: Upgrade starkgate devnet + needs: [build] runs-on: ubuntu-latest steps: - name: Checkout repository @@ -85,7 +78,7 @@ jobs: credentials: ${{ secrets.gcp_token }} - name: Helm tool installer uses: Azure/setup-helm@v2.0 - - name: Show directory + - name: Download starkware-third-party repo from S3. env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -94,7 +87,9 @@ jobs: helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz helm repo add starkware s3://starkware-third-party/helm-repo/charts helm repo update - helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet-guy \ + - name: Upgrade devnet using helm upgrade command. + run: | + helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet \ --values deployment/development.yml \ --set-file configMap.frontend.envs=.env.testing \ --set frontend.image.tag=${{ github.ref_name }} From d1cf1e34cea4b3ba997da61bf351471727551954 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 5 Apr 2022 19:50:38 +0300 Subject: [PATCH 12/31] Add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY secrets --- .github/workflows/push_backend_images.yml | 2 ++ .github/workflows/push_frontend_images.yml | 2 ++ .github/workflows/push_test.yml | 18 ------------------ 3 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/push_test.yml diff --git a/.github/workflows/push_backend_images.yml b/.github/workflows/push_backend_images.yml index 9820a4ef..a616d27f 100644 --- a/.github/workflows/push_backend_images.yml +++ b/.github/workflows/push_backend_images.yml @@ -14,3 +14,5 @@ jobs: dockerfile: Dockerfile.backend secrets: gcp_token: ${{ secrets.STARKGATE_SA }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/push_frontend_images.yml b/.github/workflows/push_frontend_images.yml index 5d2ae2ed..cd557eb7 100644 --- a/.github/workflows/push_frontend_images.yml +++ b/.github/workflows/push_frontend_images.yml @@ -14,3 +14,5 @@ jobs: dockerfile: Dockerfile.frontend secrets: gcp_token: ${{ secrets.STARKGATE_SA }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/push_test.yml b/.github/workflows/push_test.yml deleted file mode 100644 index 5da8ec84..00000000 --- a/.github/workflows/push_test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Docker build tag and push frontend images to GCR workflow. - -on: - push: - tags: - - t*.*.* - -jobs: - push-frontend-image: - uses: ./.github/workflows/gcr_push_workflow.yml - with: - image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend - branch_name: ${{ github.event.base_ref }} - dockerfile: Dockerfile.frontend - secrets: - gcp_token: ${{ secrets.STARKGATE_SA }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From b007f3e2593b7f61716fc467ab5ce0b266ba0ba1 Mon Sep 17 00:00:00 2001 From: CarmitKl <96685244+CarmitKl@users.noreply.github.com> Date: Mon, 11 Apr 2022 22:34:45 +0300 Subject: [PATCH 13/31] fix(Terms): add notes (#144) --- src/config/strings.js | 1 + src/routes/Terms/Terms.js | 21 ++++++++++++++++++++- src/routes/Terms/Terms.module.scss | 21 +++++++++++++++++++++ src/routes/Terms/Terms.strings.js | 4 +++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/config/strings.js b/src/config/strings.js index a71d41fd..887a10b5 100644 --- a/src/config/strings.js +++ b/src/config/strings.js @@ -18,6 +18,7 @@ const strings = { terms: { title_txt: 'Terms of Service', last_revised_txt: 'Last Revised: April 4, 2022', + notes_title_txt: 'Notes', accept_btn_txt: 'I Accept' } }, diff --git a/src/routes/Terms/Terms.js b/src/routes/Terms/Terms.js index 6e3fceab..441349f0 100644 --- a/src/routes/Terms/Terms.js +++ b/src/routes/Terms/Terms.js @@ -7,7 +7,7 @@ import {useColors, useConfig} from '../../hooks'; import {useTerms} from '../../providers/AppProvider'; import {useL1Wallet, useL2Wallet} from '../../providers/WalletsProvider'; import styles from './Terms.module.scss'; -import {ACCEPT_BTN_TXT, LAST_REVISED_TXT, TITLE_TXT} from './Terms.strings'; +import {ACCEPT_BTN_TXT, LAST_REVISED_TXT, NOTES_TITLE_TXT, TITLE_TXT} from './Terms.strings'; const STARKWARE_SITE_URL = 'https://starkware.co/'; const STARKNET_DOCS_URL = 'https://starknet.io/documentation/'; @@ -529,6 +529,25 @@ export const Terms = () => { +
+

{NOTES_TITLE_TXT}

+
+
    +
  1. + As the StarkNet becomes decentralized we may consider removing the Bridge from these + terms and taking the position that it is completely decentralized +
  2. +
  3. + TBD whether we could add a sentence that Starkware also cannot control or direct the + operation of the part of the Bridge that sits on the StarkNet in the pre-Universe + phase. +
  4. +
  5. + To discuss the extent to which we can make this statement, or can modify it for + accuracy. +
  6. +
+
{!isAcceptTerms && (
diff --git a/src/routes/Terms/Terms.module.scss b/src/routes/Terms/Terms.module.scss index 85d26c84..28a62293 100644 --- a/src/routes/Terms/Terms.module.scss +++ b/src/routes/Terms/Terms.module.scss @@ -19,6 +19,27 @@ font-size: 24px; font-weight: bold; } + + .notes { + h3 { + margin-bottom: 0; + line-height: 1; + margin-top: 50px; + } + + hr { + border-color: $--color-white; + } + + li { + margin-bottom: 4px; + + &::marker { + font-size: 16px; + font-weight: normal; + } + } + } } .acceptButton { diff --git a/src/routes/Terms/Terms.strings.js b/src/routes/Terms/Terms.strings.js index e85d26d4..d1a97750 100644 --- a/src/routes/Terms/Terms.strings.js +++ b/src/routes/Terms/Terms.strings.js @@ -1,7 +1,9 @@ import utils from '../../utils'; -const {title_txt, accept_btn_txt, last_revised_txt} = utils.getTranslation('screens.terms'); +const {title_txt, accept_btn_txt, last_revised_txt, notes_title_txt} = + utils.getTranslation('screens.terms'); export const TITLE_TXT = title_txt; export const ACCEPT_BTN_TXT = accept_btn_txt; export const LAST_REVISED_TXT = last_revised_txt; +export const NOTES_TITLE_TXT = notes_title_txt; From 1e0a94beebb2c63b9346b9a544fa0e8e2ded82e9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 11 Apr 2022 19:36:51 +0000 Subject: [PATCH 14/31] prerelease: v1.2.0-dev.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.2.0-dev.2](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.1...v1.2.0-dev.2) (2022-04-11) ### πŸ”§ Fixes * **Terms:** add notes ([#144](https://github.com/starkware-libs/starkgate-frontend/issues/144)) ([b007f3e](https://github.com/starkware-libs/starkgate-frontend/commit/b007f3e2593b7f61716fc467ab5ce0b266ba0ba1)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7ad3b2..8c66e9af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.2.0-dev.2](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.1...v1.2.0-dev.2) (2022-04-11) + + +### πŸ”§ Fixes + +* **Terms:** add notes ([#144](https://github.com/starkware-libs/starkgate-frontend/issues/144)) ([b007f3e](https://github.com/starkware-libs/starkgate-frontend/commit/b007f3e2593b7f61716fc467ab5ce0b266ba0ba1)) + ## [1.2.0-dev.1](https://github.com/starkware-libs/starkgate-frontend/compare/v1.1.0...v1.2.0-dev.1) (2022-04-11) diff --git a/package.json b/package.json index 7eb72d5e..bddd4412 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starkgate-frontend", - "version": "1.2.0-dev.1", + "version": "1.2.0-dev.2", "homepage": "./", "scripts": { "clean": "rm -rf ./dist", From 886730168467fc326552cefb7573e16db0075b7d Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 12 Apr 2022 14:12:35 +0300 Subject: [PATCH 15/31] Add stage --- .github/workflows/push_frontend_images.yml | 13 +++ .github/workflows/upgrade_deployment.yml | 95 ++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 .github/workflows/upgrade_deployment.yml diff --git a/.github/workflows/push_frontend_images.yml b/.github/workflows/push_frontend_images.yml index cd557eb7..46c3f806 100644 --- a/.github/workflows/push_frontend_images.yml +++ b/.github/workflows/push_frontend_images.yml @@ -7,6 +7,19 @@ on: jobs: push-frontend-image: + if: github.event.base_ref == 'guy' + uses: ./.github/workflows/gcr_push_workflow.yml + with: + image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend + branch_name: ${{ github.event.base_ref }} + dockerfile: Dockerfile.frontend + secrets: + gcp_token: ${{ secrets.STARKGATE_SA }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + deploy_devnet: + if: github.event.base_ref == 'refs/heads/guy/master/dev_helm_deployment' uses: ./.github/workflows/gcr_push_workflow.yml with: image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend diff --git a/.github/workflows/upgrade_deployment.yml b/.github/workflows/upgrade_deployment.yml new file mode 100644 index 00000000..2f043b05 --- /dev/null +++ b/.github/workflows/upgrade_deployment.yml @@ -0,0 +1,95 @@ +name: Push docker image to GCR reusable workflow + +on: + workflow_call: + inputs: + image_name: + required: true + type: string + branch_name: + required: true + type: string + dockerfile: + required: true + type: string + secrets: + gcp_token: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true +jobs: + build: + name: Build tag and push docker images to GCR. + runs-on: ubuntu-latest + steps: + - name: Login to Gcloud using starkgate service account. + uses: google-github-actions/setup-gcloud@v0 + with: + project_id: starkware-dev + service_account_email: starkgate@starkware-dev.iam.gserviceaccount.com + service_account_key: ${{ secrets.gcp_token }} + + - name: Configure Docker + run: gcloud auth configure-docker --quiet + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build and push images to GCR, with tag latest and git tag. + if: ${{ inputs.branch_name == 'refs/heads/dev' }} + run: | + docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing + docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }} + docker push ${{ inputs.image_name }}:${{ github.ref_name }} + docker push ${{ inputs.image_name }} + + - name: Build with production env and push with mainnet and stable tags. + if: ${{ inputs.branch_name == 'refs/heads/master' }} + run: | + docker build . -t ${{ inputs.image_name }}:stable -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=production + docker tag ${{ inputs.image_name }}:stable ${{ inputs.image_name }}:${{ github.ref_name }}-mainnet + + docker push ${{ inputs.image_name }}:${{ github.ref_name }}-mainnet + docker push ${{ inputs.image_name }}:stable + + - name: Build with testing env and push with goerli tag. + if: ${{ inputs.branch_name == 'refs/heads/master' }} + run: | + docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing + docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }}-goerli + + docker push ${{ inputs.image_name }}:${{ github.ref_name }}-goerli + + deploy: + if: ${{ inputs.branch_name == 'refs/heads/dev' }} + name: Upgrade starkgate devnet + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup GKE cluster + uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e + with: + cluster_name: web-devs + location: us-central1 + credentials: ${{ secrets.gcp_token }} + - name: Helm tool installer + uses: Azure/setup-helm@v2.0 + - name: Download starkware-third-party repo from S3. + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-2 + run: | + helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz + helm repo add starkware s3://starkware-third-party/helm-repo/charts + helm repo update + - name: Upgrade devnet using helm upgrade command. + run: | + helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet \ + --values deployment/development.yml \ + --set-file configMap.frontend.envs=.env.testing \ + --set frontend.image.tag=${{ github.ref_name }} From 67f50f762639e272676da2779a959690d0809a38 Mon Sep 17 00:00:00 2001 From: CarmitKl <96685244+CarmitKl@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:26:04 +0300 Subject: [PATCH 16/31] fix(Faq): update question 8 (#149) --- src/config/faqs.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/config/faqs.js b/src/config/faqs.js index a34c8fbe..67021f9d 100644 --- a/src/config/faqs.js +++ b/src/config/faqs.js @@ -62,7 +62,7 @@ export const faqs = [ Our recommendation is to wait, and here is the reason why: The process of sending transactions from StarkNet to Ethereum is divided into two stages.

-
    +
    1. A waiting period of several hours is expected between the stages.
    2. At the end of the first step, you will be required to sign in order to complete the transfer. @@ -133,11 +133,16 @@ export const faqs = [ { question: 'Why can’t I use StarkGate with {insert favorite}Token?', answer: ` -

      - Initially, StarkGate Alpha will only support ETH. After time period of successful use, we will add support for: - WBTC, USDC, USDT and Dai. All relevant contract addresses, both on Ethereum and StarkNet, are available in this repo. - Further down the road, we will publish the mechanism for adding support for additional tokens. -

      +
        +
      1. + StarkGate Alpha on Goerli supports ETH and a few other ERC-20 tokens. The full list and the relevant contract addresses on Goerli, + both on Ethereum and StarkNet, are available in this repo. +
      2. +
      3. + On Mainnet, initially, StarkGate Alpha will only support ETH to allow use of the fee mechanism. + Later on, we will add support for WBTC, USDC, USDT, and DAI. Further down the road, we will publish the mechanism for adding support for additional tokens. + The relevant contract addresses on Mainnet are available in this repo. +
      4. ` }, { From 4e604bdd0a109b5f1b464afb490607305ce8d7d3 Mon Sep 17 00:00:00 2001 From: guyvelleman <93535692+guyvelleman@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:26:21 +0300 Subject: [PATCH 17/31] ci: add nginx configuration file for app routing (#150) --- Dockerfile.frontend | 4 ++++ nginx.conf | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile.frontend b/Dockerfile.frontend index 6cae4f90..07c6fecd 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -16,6 +16,10 @@ RUN yarn build:$BUILD_ENV # production environment FROM nginx:stable-alpine +# Delete default configuration file. +RUN rm /etc/nginx/conf.d/default.conf +# Copies static resources from builder stage COPY --from=build /app/build /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..77437f5d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri /index.html; + index index.html index.htm; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} From 125061d45e1cac4f982d49c19a0dce005a38ba60 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 12 Apr 2022 16:28:05 +0000 Subject: [PATCH 18/31] prerelease: v1.2.0-dev.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.2.0-dev.3](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.2...v1.2.0-dev.3) (2022-04-12) ### πŸ”§ Fixes * **Faq:** update question 8 ([#149](https://github.com/starkware-libs/starkgate-frontend/issues/149)) ([67f50f7](https://github.com/starkware-libs/starkgate-frontend/commit/67f50f762639e272676da2779a959690d0809a38)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c66e9af..abbed6f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.2.0-dev.3](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.2...v1.2.0-dev.3) (2022-04-12) + + +### πŸ”§ Fixes + +* **Faq:** update question 8 ([#149](https://github.com/starkware-libs/starkgate-frontend/issues/149)) ([67f50f7](https://github.com/starkware-libs/starkgate-frontend/commit/67f50f762639e272676da2779a959690d0809a38)) + ## [1.2.0-dev.2](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.1...v1.2.0-dev.2) (2022-04-11) diff --git a/package.json b/package.json index bddd4412..eb544136 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starkgate-frontend", - "version": "1.2.0-dev.2", + "version": "1.2.0-dev.3", "homepage": "./", "scripts": { "clean": "rm -rf ./dist", From 5dc71e5231508ddf22fbb4509c28369515993d1a Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 12 Apr 2022 20:07:07 +0300 Subject: [PATCH 19/31] Split deploy and push workflows --- .github/workflows/gcr_push_workflow.yml | 37 +------------- .github/workflows/helm_upgrade_workflow.yml | 55 +++++++++++++++++++++ .github/workflows/push_frontend_images.yml | 9 ++-- 3 files changed, 61 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/helm_upgrade_workflow.yml diff --git a/.github/workflows/gcr_push_workflow.yml b/.github/workflows/gcr_push_workflow.yml index 2f043b05..7817c11c 100644 --- a/.github/workflows/gcr_push_workflow.yml +++ b/.github/workflows/gcr_push_workflow.yml @@ -15,10 +15,7 @@ on: secrets: gcp_token: required: true - AWS_ACCESS_KEY_ID: - required: true - AWS_SECRET_ACCESS_KEY: - required: true + jobs: build: name: Build tag and push docker images to GCR. @@ -61,35 +58,3 @@ jobs: docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }}-goerli docker push ${{ inputs.image_name }}:${{ github.ref_name }}-goerli - - deploy: - if: ${{ inputs.branch_name == 'refs/heads/dev' }} - name: Upgrade starkgate devnet - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup GKE cluster - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: web-devs - location: us-central1 - credentials: ${{ secrets.gcp_token }} - - name: Helm tool installer - uses: Azure/setup-helm@v2.0 - - name: Download starkware-third-party repo from S3. - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: us-east-2 - run: | - helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz - helm repo add starkware s3://starkware-third-party/helm-repo/charts - helm repo update - - name: Upgrade devnet using helm upgrade command. - run: | - helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet \ - --values deployment/development.yml \ - --set-file configMap.frontend.envs=.env.testing \ - --set frontend.image.tag=${{ github.ref_name }} diff --git a/.github/workflows/helm_upgrade_workflow.yml b/.github/workflows/helm_upgrade_workflow.yml new file mode 100644 index 00000000..bb6087da --- /dev/null +++ b/.github/workflows/helm_upgrade_workflow.yml @@ -0,0 +1,55 @@ +name: Push docker image to GCR reusable workflow + +on: + workflow_call: + inputs: + app_name: + required: true + type: string + namespace_name: + required: true + type: string + values_file: + required: true + type: string + env_file: + required: true + type: string + secrets: + gcp_token: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true +jobs: + deploy: + name: Upgrade helm chart + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup GKE cluster + uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e + with: + cluster_name: web-devs + location: us-central1 + credentials: ${{ secrets.gcp_token }} + - name: Helm tool installer + uses: Azure/setup-helm@v2.0 + - name: Download starkware-third-party repo from S3. + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-2 + run: | + helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz + helm repo add starkware s3://starkware-third-party/helm-repo/charts + helm repo update + - name: Upgrade using helm upgrade command. + run: | + helm upgrade ${{ inputs.app_name }} starkware/webapp-general-helm \ + --namespace=${{ inputs.namespace_name }} \ + --values ${{ inputs.values_file}} \ + --set-file configMap.frontend.envs=${{ inputs.env_file }} \ + --set frontend.image.tag=${{ github.ref_name }} diff --git a/.github/workflows/push_frontend_images.yml b/.github/workflows/push_frontend_images.yml index 46c3f806..0c717308 100644 --- a/.github/workflows/push_frontend_images.yml +++ b/.github/workflows/push_frontend_images.yml @@ -7,7 +7,6 @@ on: jobs: push-frontend-image: - if: github.event.base_ref == 'guy' uses: ./.github/workflows/gcr_push_workflow.yml with: image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend @@ -20,11 +19,13 @@ jobs: deploy_devnet: if: github.event.base_ref == 'refs/heads/guy/master/dev_helm_deployment' + needs: [push-frontend-image] uses: ./.github/workflows/gcr_push_workflow.yml with: - image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend - branch_name: ${{ github.event.base_ref }} - dockerfile: Dockerfile.frontend + app_name: starkgate + namespace_name: starkgate-devnet-guy + values_file: deployment/development.yml + env_file: .env.testing secrets: gcp_token: ${{ secrets.STARKGATE_SA }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 958174997761dba702604fe558772e986b1cc3f2 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 12 Apr 2022 20:08:56 +0300 Subject: [PATCH 20/31] Delete aws secrets --- .github/workflows/push_frontend_images.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/push_frontend_images.yml b/.github/workflows/push_frontend_images.yml index 0c717308..91260796 100644 --- a/.github/workflows/push_frontend_images.yml +++ b/.github/workflows/push_frontend_images.yml @@ -14,8 +14,6 @@ jobs: dockerfile: Dockerfile.frontend secrets: gcp_token: ${{ secrets.STARKGATE_SA }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} deploy_devnet: if: github.event.base_ref == 'refs/heads/guy/master/dev_helm_deployment' From 3ffdbf5924c4a014cb71cc5d59e9ab6c04883025 Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 12 Apr 2022 20:11:49 +0300 Subject: [PATCH 21/31] Change workflow name --- .github/workflows/push_frontend_images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_frontend_images.yml b/.github/workflows/push_frontend_images.yml index 91260796..a8861eff 100644 --- a/.github/workflows/push_frontend_images.yml +++ b/.github/workflows/push_frontend_images.yml @@ -18,7 +18,7 @@ jobs: deploy_devnet: if: github.event.base_ref == 'refs/heads/guy/master/dev_helm_deployment' needs: [push-frontend-image] - uses: ./.github/workflows/gcr_push_workflow.yml + uses: ./.github/workflows/helm_upgrade_workflow.yml with: app_name: starkgate namespace_name: starkgate-devnet-guy From 36d0b979bd86dddeb38106172a6398e0c56b108b Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Tue, 12 Apr 2022 20:35:02 +0300 Subject: [PATCH 22/31] Add env vars --- .github/workflows/helm_upgrade_workflow.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/helm_upgrade_workflow.yml b/.github/workflows/helm_upgrade_workflow.yml index bb6087da..34b19803 100644 --- a/.github/workflows/helm_upgrade_workflow.yml +++ b/.github/workflows/helm_upgrade_workflow.yml @@ -47,6 +47,10 @@ jobs: helm repo add starkware s3://starkware-third-party/helm-repo/charts helm repo update - name: Upgrade using helm upgrade command. + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-2 run: | helm upgrade ${{ inputs.app_name }} starkware/webapp-general-helm \ --namespace=${{ inputs.namespace_name }} \ From 6ca68022ff236cc2196fa209fb394aa1b759522e Mon Sep 17 00:00:00 2001 From: Guy Velleman Date: Wed, 13 Apr 2022 09:22:57 +0300 Subject: [PATCH 23/31] Delete test file --- .github/workflows/upgrade_deployment.yml | 95 ------------------------ 1 file changed, 95 deletions(-) delete mode 100644 .github/workflows/upgrade_deployment.yml diff --git a/.github/workflows/upgrade_deployment.yml b/.github/workflows/upgrade_deployment.yml deleted file mode 100644 index 2f043b05..00000000 --- a/.github/workflows/upgrade_deployment.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Push docker image to GCR reusable workflow - -on: - workflow_call: - inputs: - image_name: - required: true - type: string - branch_name: - required: true - type: string - dockerfile: - required: true - type: string - secrets: - gcp_token: - required: true - AWS_ACCESS_KEY_ID: - required: true - AWS_SECRET_ACCESS_KEY: - required: true -jobs: - build: - name: Build tag and push docker images to GCR. - runs-on: ubuntu-latest - steps: - - name: Login to Gcloud using starkgate service account. - uses: google-github-actions/setup-gcloud@v0 - with: - project_id: starkware-dev - service_account_email: starkgate@starkware-dev.iam.gserviceaccount.com - service_account_key: ${{ secrets.gcp_token }} - - - name: Configure Docker - run: gcloud auth configure-docker --quiet - - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Build and push images to GCR, with tag latest and git tag. - if: ${{ inputs.branch_name == 'refs/heads/dev' }} - run: | - docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing - docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }} - docker push ${{ inputs.image_name }}:${{ github.ref_name }} - docker push ${{ inputs.image_name }} - - - name: Build with production env and push with mainnet and stable tags. - if: ${{ inputs.branch_name == 'refs/heads/master' }} - run: | - docker build . -t ${{ inputs.image_name }}:stable -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=production - docker tag ${{ inputs.image_name }}:stable ${{ inputs.image_name }}:${{ github.ref_name }}-mainnet - - docker push ${{ inputs.image_name }}:${{ github.ref_name }}-mainnet - docker push ${{ inputs.image_name }}:stable - - - name: Build with testing env and push with goerli tag. - if: ${{ inputs.branch_name == 'refs/heads/master' }} - run: | - docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing - docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }}-goerli - - docker push ${{ inputs.image_name }}:${{ github.ref_name }}-goerli - - deploy: - if: ${{ inputs.branch_name == 'refs/heads/dev' }} - name: Upgrade starkgate devnet - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup GKE cluster - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: web-devs - location: us-central1 - credentials: ${{ secrets.gcp_token }} - - name: Helm tool installer - uses: Azure/setup-helm@v2.0 - - name: Download starkware-third-party repo from S3. - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: us-east-2 - run: | - helm plugin install https://starkware-third-party.s3.us-east-2.amazonaws.com/k8s/helm-s3/helm-s3-v0.9.2.tar.gz - helm repo add starkware s3://starkware-third-party/helm-repo/charts - helm repo update - - name: Upgrade devnet using helm upgrade command. - run: | - helm upgrade starkgate starkware/webapp-general-helm --namespace=starkgate-devnet \ - --values deployment/development.yml \ - --set-file configMap.frontend.envs=.env.testing \ - --set frontend.image.tag=${{ github.ref_name }} From 017ce0a9a86942233cbc0d6affcaecc309714ac5 Mon Sep 17 00:00:00 2001 From: Dan Ziv Date: Wed, 13 Apr 2022 12:55:55 +0300 Subject: [PATCH 24/31] fix: unsupported chain id does not showing (#151) --- .env.development | 2 +- .env.production | 2 +- .env.testing | 2 +- package.json | 2 +- src/App.js | 21 +++---- src/components/Containers/Header/Header.js | 34 +++++----- .../Containers/Header/Header.strings.js | 8 +-- .../UI/LoginErrorMessage/LoginErrorMessage.js | 12 ++++ .../LoginErrorMessage.module.scss | 14 +++++ src/components/UI/index.js | 1 + src/config/envs.js | 2 +- src/config/strings.js | 3 +- src/enums/ChainType.js | 8 +-- src/enums/ErrorType.js | 4 ++ src/enums/index.js | 1 + src/providers/AppProvider/app-hooks.js | 6 +- .../WalletProvider/WalletProvider.js | 5 +- .../WalletsProvider/WalletsProvider.js | 4 +- src/routes/Login/Login.js | 62 ++++++++----------- src/routes/Login/Login.module.scss | 12 ---- src/routes/Login/Login.strings.js | 11 +++- yarn.lock | 8 +-- 22 files changed, 118 insertions(+), 106 deletions(-) create mode 100644 src/components/UI/LoginErrorMessage/LoginErrorMessage.js create mode 100644 src/components/UI/LoginErrorMessage/LoginErrorMessage.module.scss create mode 100644 src/enums/ErrorType.js diff --git a/.env.development b/.env.development index ff0c3018..cec0a4b5 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ REACT_APP_AUTO_CONNECT=false # 20 seconds REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=20000 # goerli testnet -REACT_APP_SUPPORTED_CHAIN_IDS=5 +REACT_APP_SUPPORTED_CHAIN_ID=5 REACT_APP_STARKNET_CONTRACT_ADDRESS=0xde29d060D45901Fb19ED6C6e959EB22d8626708e REACT_APP_ETHERSCAN_URL=https://goerli.etherscan.io REACT_APP_VOYAGER_URL=https://goerli.voyager.online diff --git a/.env.production b/.env.production index 6de75808..f128ade0 100644 --- a/.env.production +++ b/.env.production @@ -3,7 +3,7 @@ REACT_APP_AUTO_CONNECT=false # 30 seconds REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=30000 # mainnet -REACT_APP_SUPPORTED_CHAIN_IDS=1 +REACT_APP_SUPPORTED_CHAIN_ID=1 REACT_APP_STARKNET_CONTRACT_ADDRESS= REACT_APP_ETHERSCAN_URL=https://etherscan.io REACT_APP_VOYAGER_URL=https://voyager.online diff --git a/.env.testing b/.env.testing index daaec135..1f9889b6 100644 --- a/.env.testing +++ b/.env.testing @@ -3,7 +3,7 @@ REACT_APP_AUTO_CONNECT=false # 20 seconds REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=20000 # goerli testnet -REACT_APP_SUPPORTED_CHAIN_IDS=5 +REACT_APP_SUPPORTED_CHAIN_ID=5 REACT_APP_STARKNET_CONTRACT_ADDRESS=0xde29d060D45901Fb19ED6C6e959EB22d8626708e REACT_APP_ETHERSCAN_URL=https://goerli.etherscan.io REACT_APP_VOYAGER_URL=https://goerli.voyager.online diff --git a/package.json b/package.json index eb544136..a105e375 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "use-async-memo": "^1.2.3", "use-breakpoint": "^3.0.1", "use-deep-compare-effect": "^1.8.1", - "use-wallet": "^0.13.4", + "use-wallet": "^0.13.6", "uuid": "^8.3.2", "web3": "^1.7.0" }, diff --git a/src/App.js b/src/App.js index 98a56252..75d10ab1 100644 --- a/src/App.js +++ b/src/App.js @@ -1,36 +1,33 @@ import React from 'react'; -import {Route, Routes, useLocation} from 'react-router-dom'; +import {Navigate, Route, Routes, useLocation} from 'react-router-dom'; import styles from './App.module.scss'; import {Footer, Header} from './components/Containers'; import {StyledBackground} from './components/UI'; -import {useApp} from './providers/AppProvider'; -import {Faq, Bridge, Login, ProtectedRoute, Terms} from './routes'; +import {useApp, useLogin} from './providers/AppProvider'; +import {Bridge, Faq, Login, ProtectedRoute, Terms} from './routes'; export const App = () => { - const {isLoggedIn, isAcceptTerms} = useApp(); + const {isAcceptTerms} = useApp(); const {pathname} = useLocation(); - const informativeRoutes = ['/terms', '/faq']; + const {isLoggedIn} = useLogin(); return (
        - + - + + {isLoggedIn ? : } } path="/" /> } path="/terms" /> - } path="/login" /> } path="/faq" /> + } path="*" />
        diff --git a/src/components/Containers/Header/Header.js b/src/components/Containers/Header/Header.js index 124ffe5e..6fd6b57f 100644 --- a/src/components/Containers/Header/Header.js +++ b/src/components/Containers/Header/Header.js @@ -1,63 +1,64 @@ import React from 'react'; -import {useNavigate, useLocation} from 'react-router-dom'; +import {useLocation, useNavigate} from 'react-router-dom'; import useBreakpoint from 'use-breakpoint'; import {track} from '../../../analytics'; import {ReactComponent as StarkGateLogo} from '../../../assets/img/starkgate.svg'; import constants from '../../../config/constants'; +import envs from '../../../config/envs'; import {Breakpoint} from '../../../enums'; import {useColors} from '../../../hooks'; import {useLogin} from '../../../providers/AppProvider'; import {useMenu} from '../../../providers/MenuProvider'; import {useIsL1, useIsL2} from '../../../providers/TransferProvider'; -import {useL1Wallet, useL2Wallet, useWallets} from '../../../providers/WalletsProvider'; +import {useL1Wallet, useL2Wallet} from '../../../providers/WalletsProvider'; import utils from '../../../utils'; import {Tab, WalletButton} from '../../UI'; import styles from './Header.module.scss'; import {CHAIN_TXT, TAB_DISCORD_TXT, TAB_FAQ_TXT, TAB_TERMS_TXT} from './Header.strings'; const {DISCORD_LINK_URL} = constants; +const {env} = envs; export const Header = () => { const navigate = useNavigate(); const {pathname} = useLocation(); - const {chainName} = useWallets(); const {showAccountMenu, showTransferMenu} = useMenu(); const [, swapToL1] = useIsL1(); const [, swapToL2] = useIsL2(); - const {account: l1Account, isConnected: isL1AccountConnected, config: l1Config} = useL1Wallet(); - const {account: l2Account, isConnected: isL2AccountConnected, config: l2Config} = useL2Wallet(); + const {account: l1Account, config: l1Config} = useL1Wallet(); + const {account: l2Account, config: l2Config} = useL2Wallet(); const {breakpoint} = useBreakpoint(Breakpoint); const {colorDiscord, colorWhiteOp50} = useColors(); const {isLoggedIn} = useLogin(); - const maybeNavigateToIndex = () => { + const maybeNavigateToBridge = () => { pathname !== '/' && navigate('/'); }; const onL2WalletButtonClick = () => { - maybeNavigateToIndex(); swapToL2(); showAccountMenu(); + maybeNavigateToBridge(); }; const onL1WalletButtonClick = () => { - maybeNavigateToIndex(); swapToL1(); showAccountMenu(); + maybeNavigateToBridge(); }; const onLogoClick = () => { - maybeNavigateToIndex(); showTransferMenu(); + maybeNavigateToBridge(); }; const onTabFaqClick = () => { - navigate('faq', {replace: true}); + navigate('/faq'); }; const onTabTermsClick = () => { - navigate('terms', {replace: true}); + navigate('/terms'); }; const onTabDiscordClick = () => { @@ -71,23 +72,22 @@ export const Header = () => {
        - {isLoggedIn && ( -
        {CHAIN_TXT(chainName)}
        + {env !== 'production' && ( +
        {CHAIN_TXT}
        )}
        -
        + - - {isL1AccountConnected && ( + {isLoggedIn && ( )} - {isL2AccountConnected && ( + {isLoggedIn && ( - utils.string.capitalize( - utils.object.evaluate(utils.getTranslation('containers.header.chain_txt'), {chainName}) - ); - +export const CHAIN_TXT = utils.getTranslation('containers.header.chain_txt'); export const TAB_DISCORD_TXT = utils.getTranslation('containers.header.tab_discord_txt'); - export const TAB_FAQ_TXT = utils.getTranslation('containers.header.tab_faq_txt'); - export const TAB_TERMS_TXT = utils.getTranslation('containers.header.tab_terms_txt'); diff --git a/src/components/UI/LoginErrorMessage/LoginErrorMessage.js b/src/components/UI/LoginErrorMessage/LoginErrorMessage.js new file mode 100644 index 00000000..ba8ea14a --- /dev/null +++ b/src/components/UI/LoginErrorMessage/LoginErrorMessage.js @@ -0,0 +1,12 @@ +import PropTypes from 'prop-types'; +import React from 'react'; + +import styles from './LoginErrorMessage.module.scss'; + +export const LoginErrorMessage = ({message}) => { + return
        ❗ {message}
        ; +}; + +LoginErrorMessage.propTypes = { + message: PropTypes.string +}; diff --git a/src/components/UI/LoginErrorMessage/LoginErrorMessage.module.scss b/src/components/UI/LoginErrorMessage/LoginErrorMessage.module.scss new file mode 100644 index 00000000..3b60159c --- /dev/null +++ b/src/components/UI/LoginErrorMessage/LoginErrorMessage.module.scss @@ -0,0 +1,14 @@ +@import '../../../index'; + +.loginErrorMessage { + text-align: center; + margin-top: 20px; + line-height: 20px; + padding: 7px; + font-size: 15px; + font-weight: 500; + border: 1px solid $--color-error; + color: $--color-error; + background-color: $--color-white; + border-radius: 7px; +} diff --git a/src/components/UI/index.js b/src/components/UI/index.js index 37c9f647..851e484d 100644 --- a/src/components/UI/index.js +++ b/src/components/UI/index.js @@ -32,5 +32,6 @@ export * from './RefreshIcon/RefreshIcon'; export * from './Stepper/Stepper'; export * from './StyledBackground/StyledBackground'; export * from './FullScreenContainer/FullScreenContainer'; +export * from './LoginErrorMessage/LoginErrorMessage'; export * from './Modal'; export * from './Toast'; diff --git a/src/config/envs.js b/src/config/envs.js index effcb35c..0d385195 100644 --- a/src/config/envs.js +++ b/src/config/envs.js @@ -6,7 +6,7 @@ const envs = { autoConnect: Boolean(process.env.REACT_APP_AUTO_CONNECT), pollBlockNumberInterval: Number(process.env.REACT_APP_POLL_BLOCK_NUMBER_INTERVAL), supportedTokens: process.env.REACT_APP_SUPPORTED_TOKENS.split(','), - supportedChainIds: process.env.REACT_APP_SUPPORTED_CHAIN_IDS.split(' ').map(id => Number(id)), + supportedChainId: Number(process.env.REACT_APP_SUPPORTED_CHAIN_ID), starknetContractAddress: process.env.REACT_APP_STARKNET_CONTRACT_ADDRESS, etherscanUrl: process.env.REACT_APP_ETHERSCAN_URL, etherscanTxUrl: tx => diff --git a/src/config/strings.js b/src/config/strings.js index 887a10b5..bc66e7f2 100644 --- a/src/config/strings.js +++ b/src/config/strings.js @@ -1,7 +1,7 @@ const strings = { containers: { header: { - chain_txt: '{{chainName}} testnet', + chain_txt: 'Goerli testnet', wallet_btn_txt: 'Account | {{address}}', tab_discord_txt: 'Discord', tab_terms_txt: 'Terms', @@ -29,6 +29,7 @@ const strings = { subtitle_txt: 'Please select {{networkName}} wallet to connect with this dApp:', download_txt: ['Don’t have a wallet?', 'Download Here'], modal_txt: 'Waiting for confirmation from {{walletName}}', + unsupported_chain_id_txt: 'Please select {{chainName}} in your wallet', unsupported_browser_txt: "Note - The current version of StarkGate (Alpha) doesn't support your browser. Use Chrome to connect." }, diff --git a/src/enums/ChainType.js b/src/enums/ChainType.js index 09bdceb0..5de207ff 100644 --- a/src/enums/ChainType.js +++ b/src/enums/ChainType.js @@ -12,19 +12,19 @@ export const ChainType = { export const ChainInfo = { L1: { [ChainType.L1.MAIN]: { - NAME: 'main' + NAME: 'Ethereum Mainnet' }, [ChainType.L1.GOERLI]: { - NAME: 'goerli' + NAME: 'Goerli Testnet' } }, L2: { [ChainType.L2.MAIN]: { - NAME: 'main', + NAME: 'Ethereum Mainnet', ID_PREFIX: '23448594291968334' }, [ChainType.L2.GOERLI]: { - NAME: 'goerli', + NAME: 'Goerli Testnet', ID_PREFIX: '1536727068981429685321' } } diff --git a/src/enums/ErrorType.js b/src/enums/ErrorType.js new file mode 100644 index 00000000..f9b7cb0e --- /dev/null +++ b/src/enums/ErrorType.js @@ -0,0 +1,4 @@ +export const ErrorType = { + UNSUPPORTED_BROWSER: 0, + UNSUPPORTED_CHAIN_ID: 1 +}; diff --git a/src/enums/index.js b/src/enums/index.js index d338434f..b611f0f3 100644 --- a/src/enums/index.js +++ b/src/enums/index.js @@ -12,3 +12,4 @@ export * from './Breakpoint'; export * from './ToastType'; export * from './TransferError'; export * from './TransferStep'; +export * from './ErrorType'; diff --git a/src/providers/AppProvider/app-hooks.js b/src/providers/AppProvider/app-hooks.js index fe8a304b..7a9b6f1e 100644 --- a/src/providers/AppProvider/app-hooks.js +++ b/src/providers/AppProvider/app-hooks.js @@ -1,5 +1,6 @@ import {useContext} from 'react'; +import {useL1Wallet, useL2Wallet} from '../WalletsProvider'; import {AppContext} from './app-context'; export const useApp = () => useContext(AppContext); @@ -11,7 +12,8 @@ export const useTerms = () => { }; export const useLogin = () => { - const {isLoggedIn, login, logout} = useApp(); + const {isConnected: isL1Connected} = useL1Wallet(); + const {isConnected: isL2Connected} = useL2Wallet(); - return {isLoggedIn, login, logout}; + return {isLoggedIn: isL1Connected && isL2Connected}; }; diff --git a/src/providers/WalletProvider/WalletProvider.js b/src/providers/WalletProvider/WalletProvider.js index e0bf4725..063dc4e5 100644 --- a/src/providers/WalletProvider/WalletProvider.js +++ b/src/providers/WalletProvider/WalletProvider.js @@ -5,13 +5,14 @@ import {UseWalletProvider as UseWalletProviderWrapper} from 'use-wallet'; import {useConfig} from '../../hooks'; export const WalletProvider = ({children}) => { - const {pollBalanceInterval, pollBlockNumberInterval, supportedChainIds} = useConfig(); + const {pollBalanceInterval, pollBlockNumberInterval, supportedChainId} = useConfig(); + return ( { const maybeUpdateL1Wallet = () => { // To support serializable object in the store - const serialError = error ? {...error} : null; + const serializedError = status === 'error' ? {...error} : null; updateL1Wallet({ account, status, chainId, - error: serialError, + error: serializedError, chainName: networkName, isConnected: isConnected() }); diff --git a/src/routes/Login/Login.js b/src/routes/Login/Login.js index 5d48f769..88fba421 100644 --- a/src/routes/Login/Login.js +++ b/src/routes/Login/Login.js @@ -1,11 +1,9 @@ import React, {useEffect, useRef, useState} from 'react'; -import {useNavigate} from 'react-router-dom'; import {track, TrackEvent} from '../../analytics'; -import {WalletLogin} from '../../components/UI'; -import {ChainInfo, NetworkType, WalletStatus, WalletType} from '../../enums'; +import {LoginErrorMessage, WalletLogin} from '../../components/UI'; +import {ChainInfo, ErrorType, NetworkType, WalletStatus, WalletType} from '../../enums'; import {useConfig, useWalletHandlerProvider} from '../../hooks'; -import {useLogin} from '../../providers/AppProvider'; import {useHideModal, useProgressModal} from '../../providers/ModalProvider'; import {useL1Wallet, useL2Wallet, useWallets} from '../../providers/WalletsProvider'; import utils from '../../utils'; @@ -16,57 +14,53 @@ import { MODAL_TXT, SUBTITLE_TXT, TITLE_TXT, - UNSUPPORTED_BROWSER_TXT + UNSUPPORTED_BROWSER_TXT, + UNSUPPORTED_CHAIN_ID_TXT } from './Login.strings'; export const Login = () => { const {autoConnect} = useConfig(); const [selectedWalletName, setSelectedWalletName] = useState(''); - const [errorMsg, setErrorMsg] = useState(''); + const [error, setError] = useState(null); const [walletType, setWalletType] = useState(WalletType.L1); const modalTimeoutId = useRef(null); const hideModal = useHideModal(); const showProgressModal = useProgressModal(); const getWalletHandlers = useWalletHandlerProvider(); - const {status, error} = useWallets(); + const {status, error: walletError} = useWallets(); const {connectWallet: connectL1Wallet, isConnected: isConnectedL1Wallet} = useL1Wallet(); - const {connectWallet: connectL2Wallet, isConnected: isConnectedL2Wallet} = useL2Wallet(); - const {login} = useLogin(); - const navigate = useNavigate(); + const {connectWallet: connectL2Wallet} = useL2Wallet(); + const {supportedChainId} = useConfig(); useEffect(() => { track(TrackEvent.LOGIN_SCREEN); + if (!utils.browser.isChrome()) { + setError({type: ErrorType.UNSUPPORTED_BROWSER, message: UNSUPPORTED_BROWSER_TXT}); + } }, []); useEffect(() => { let timeoutId; - if (!utils.browser.isChrome()) { - track(TrackEvent.LOGIN.LOGIN_ERROR, {message: UNSUPPORTED_BROWSER_TXT}); - setErrorMsg(UNSUPPORTED_BROWSER_TXT); - return; - } - if (autoConnect) { + if (error) { + track(TrackEvent.LOGIN.LOGIN_ERROR, error); + } else if (!error && autoConnect) { const handlers = getWalletHandlers(walletType); if (handlers.length > 0) { timeoutId = setTimeout(() => onWalletConnect(handlers[0]), AUTO_CONNECT_TIMEOUT_DURATION); } } return () => clearTimeout(timeoutId); - }, [walletType, getWalletHandlers]); + }, [error, walletType, getWalletHandlers]); useEffect(() => { - if (isConnectedL1Wallet && isConnectedL2Wallet) { - login(); - navigate('/'); - } if (isConnectedL1Wallet) { setWalletType(WalletType.L2); } - }, [isConnectedL1Wallet, isConnectedL2Wallet]); + }, [isConnectedL1Wallet]); useEffect(() => { - error && handleError(error); - }, [error]); + walletError && handleWalletError(walletError); + }, [walletError]); useEffect(() => { switch (status) { @@ -75,7 +69,7 @@ export const Login = () => { break; case WalletStatus.CONNECTED: setSelectedWalletName(''); - setErrorMsg(''); + setError(null); maybeHideModal(); break; case WalletStatus.ERROR: @@ -109,18 +103,14 @@ export const Login = () => { } }; - const handleError = error => { + const handleWalletError = error => { if (error.name === 'ChainUnsupportedError') { - const message = error.message.replace(/\d+/g, match => { - let msg = match; - const chainName = utils.string.capitalize(ChainInfo.L1[Number(match)]?.NAME); - if (chainName) { - msg += ` (${utils.string.capitalize(ChainInfo.L1[Number(match)].NAME)})`; - } - return msg; + setError({ + type: ErrorType.UNSUPPORTED_CHAIN_ID, + message: utils.object.evaluate(UNSUPPORTED_CHAIN_ID_TXT, { + chainName: ChainInfo.L1[supportedChainId].NAME + }) }); - track(TrackEvent.LOGIN.LOGIN_ERROR, {message}); - setErrorMsg(message); } }; @@ -165,7 +155,7 @@ export const Login = () => { {SUBTITLE_TXT(walletType === WalletType.L1 ? NetworkType.L1.name : NetworkType.L2.name)}

        {renderLoginWallets()}
        - {errorMsg &&
        {errorMsg}
        } + {error && }
        diff --git a/src/routes/Login/Login.module.scss b/src/routes/Login/Login.module.scss index e65cd784..e05d1fee 100644 --- a/src/routes/Login/Login.module.scss +++ b/src/routes/Login/Login.module.scss @@ -5,7 +5,6 @@ $text-color: $--color-white; $download-color: $--color-white-1; $download-button-color: $--color-beta; $container-color: $--color-alpha-3; -$error-color: $--color-error; .login { position: absolute; @@ -40,17 +39,6 @@ $error-color: $--color-error; box-sizing: border-box; border-radius: 8px; } - - .errorMsg { - margin-top: 20px; - line-height: 20px; - padding: 7px; - font-size: 14px; - border: 1px solid $error-color; - color: $error-color; - background-color: $text-color; - border-radius: 7px; - } } .download { diff --git a/src/routes/Login/Login.strings.js b/src/routes/Login/Login.strings.js index 98fe3f36..051d04d2 100644 --- a/src/routes/Login/Login.strings.js +++ b/src/routes/Login/Login.strings.js @@ -1,10 +1,17 @@ import utils from '../../utils'; -const {title_txt, subtitle_txt, download_txt, modal_txt, unsupported_browser_txt} = - utils.getTranslation('menus.login'); +const { + title_txt, + subtitle_txt, + download_txt, + modal_txt, + unsupported_chain_id_txt, + unsupported_browser_txt +} = utils.getTranslation('menus.login'); export const TITLE_TXT = title_txt; export const DOWNLOAD_TEXT = download_txt; export const UNSUPPORTED_BROWSER_TXT = unsupported_browser_txt; export const SUBTITLE_TXT = networkName => utils.object.evaluate(subtitle_txt, {networkName}); export const MODAL_TXT = walletName => utils.object.evaluate(modal_txt, {walletName}); +export const UNSUPPORTED_CHAIN_ID_TXT = unsupported_chain_id_txt; diff --git a/yarn.lock b/yarn.lock index 795a051e..ae8c7a6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20574,10 +20574,10 @@ use-deep-compare-effect@^1.8.1: "@babel/runtime" "^7.12.5" dequal "^2.0.2" -use-wallet@^0.13.4: - version "0.13.4" - resolved "https://registry.yarnpkg.com/use-wallet/-/use-wallet-0.13.4.tgz#78c8facfdd910a03719ef808043534a8f367c20a" - integrity sha512-C5bBobwAKi/SbIX+JzHkxChqU1A2tIcx8fQPoL0gzTGYkqvH97EchnT8yRQGMl2RiICua2nGMLrfa42Yexzs+Q== +use-wallet@^0.13.6: + version "0.13.6" + resolved "https://registry.yarnpkg.com/use-wallet/-/use-wallet-0.13.6.tgz#4ba24005550943fe6640d4a29fbf7e8bfa8c879b" + integrity sha512-GBypStD/y4tqUtWuDG2qhAr8XoTqMzoUybFQmHYOireeprmjqXPKFimhW7OpOZqt1hB21FmDYoGyFUgrbOzpeQ== dependencies: "@aragon/provided-connector" "^6.0.8" "@typescript-eslint/parser" "^4.1.0" From 04077432ada0ceea85dcc2977819fc6fb14ed6ad Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 13 Apr 2022 09:57:36 +0000 Subject: [PATCH 25/31] prerelease: v1.2.0-dev.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.2.0-dev.4](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.3...v1.2.0-dev.4) (2022-04-13) ### πŸ”§ Fixes * unsupported chain id does not showing ([#151](https://github.com/starkware-libs/starkgate-frontend/issues/151)) ([017ce0a](https://github.com/starkware-libs/starkgate-frontend/commit/017ce0a9a86942233cbc0d6affcaecc309714ac5)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abbed6f0..a4ac2b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.2.0-dev.4](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.3...v1.2.0-dev.4) (2022-04-13) + + +### πŸ”§ Fixes + +* unsupported chain id does not showing ([#151](https://github.com/starkware-libs/starkgate-frontend/issues/151)) ([017ce0a](https://github.com/starkware-libs/starkgate-frontend/commit/017ce0a9a86942233cbc0d6affcaecc309714ac5)) + ## [1.2.0-dev.3](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.2...v1.2.0-dev.3) (2022-04-12) diff --git a/package.json b/package.json index a105e375..5928703c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starkgate-frontend", - "version": "1.2.0-dev.3", + "version": "1.2.0-dev.4", "homepage": "./", "scripts": { "clean": "rm -rf ./dist", From 74e6861e3a7c00623e83fcfecfb0fcafbfc4a89e Mon Sep 17 00:00:00 2001 From: CarmitKl <96685244+CarmitKl@users.noreply.github.com> Date: Wed, 13 Apr 2022 15:26:59 +0300 Subject: [PATCH 26/31] fix: app crashed when trying to connect while ArgentX wasn't installed --- src/config/envs.js | 2 +- src/providers/WalletsProvider/WalletsProvider.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/config/envs.js b/src/config/envs.js index 0d385195..fcf52fec 100644 --- a/src/config/envs.js +++ b/src/config/envs.js @@ -3,7 +3,7 @@ import utils from '../utils'; const envs = { env: process.env.NODE_ENV, appUrl: process.env.REACT_APP_URL, - autoConnect: Boolean(process.env.REACT_APP_AUTO_CONNECT), + autoConnect: process.env.REACT_APP_AUTO_CONNECT === 'true', pollBlockNumberInterval: Number(process.env.REACT_APP_POLL_BLOCK_NUMBER_INTERVAL), supportedTokens: process.env.REACT_APP_SUPPORTED_TOKENS.split(','), supportedChainId: Number(process.env.REACT_APP_SUPPORTED_CHAIN_ID), diff --git a/src/providers/WalletsProvider/WalletsProvider.js b/src/providers/WalletsProvider/WalletsProvider.js index f2b37f95..9d0dea31 100644 --- a/src/providers/WalletsProvider/WalletsProvider.js +++ b/src/providers/WalletsProvider/WalletsProvider.js @@ -41,8 +41,11 @@ export const WalletsProvider = ({children}) => { }; const connectL2Wallet = async walletConfig => { - await getStarknet().enable(!autoConnect && {showModal: true}); - setL2WalletConfig(walletConfig); + try { + await getStarknet().enable(!autoConnect && {showModal: true}); + setL2WalletConfig(walletConfig); + // eslint-disable-next-line no-empty + } catch {} }; const resetWallet = () => { From c86cc433ad7d28055f355e2d973e86159956cc5b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 13 Apr 2022 12:28:32 +0000 Subject: [PATCH 27/31] prerelease: v1.2.0-dev.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.2.0-dev.5](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.4...v1.2.0-dev.5) (2022-04-13) ### πŸ”§ Fixes * app crashed when trying to connect while ArgentX wasn't installed ([74e6861](https://github.com/starkware-libs/starkgate-frontend/commit/74e6861e3a7c00623e83fcfecfb0fcafbfc4a89e)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4ac2b0d..57f7b30d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.2.0-dev.5](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.4...v1.2.0-dev.5) (2022-04-13) + + +### πŸ”§ Fixes + +* app crashed when trying to connect while ArgentX wasn't installed ([74e6861](https://github.com/starkware-libs/starkgate-frontend/commit/74e6861e3a7c00623e83fcfecfb0fcafbfc4a89e)) + ## [1.2.0-dev.4](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.3...v1.2.0-dev.4) (2022-04-13) diff --git a/package.json b/package.json index 5928703c..0e9e6fc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starkgate-frontend", - "version": "1.2.0-dev.4", + "version": "1.2.0-dev.5", "homepage": "./", "scripts": { "clean": "rm -rf ./dist", From 1cc2b8c0292fed1a1b155b269e8e6c0d142eeb94 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 13 Apr 2022 13:22:52 +0000 Subject: [PATCH 28/31] release: v1.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.2.0](https://github.com/starkware-libs/starkgate-frontend/compare/v1.1.0...v1.2.0) (2022-04-13) ### 🧩 Features * terms of use ([#141](https://github.com/starkware-libs/starkgate-frontend/issues/141)) ([8d9fe79](https://github.com/starkware-libs/starkgate-frontend/commit/8d9fe7957e09c739e1e79801eaf507178854f944)) ### πŸ”§ Fixes * app crashed when trying to connect while ArgentX wasn't installed ([74e6861](https://github.com/starkware-libs/starkgate-frontend/commit/74e6861e3a7c00623e83fcfecfb0fcafbfc4a89e)) * **Faq:** update question 8 ([#149](https://github.com/starkware-libs/starkgate-frontend/issues/149)) ([67f50f7](https://github.com/starkware-libs/starkgate-frontend/commit/67f50f762639e272676da2779a959690d0809a38)) * **Terms:** add notes ([#144](https://github.com/starkware-libs/starkgate-frontend/issues/144)) ([b007f3e](https://github.com/starkware-libs/starkgate-frontend/commit/b007f3e2593b7f61716fc467ab5ce0b266ba0ba1)) * unsupported chain id does not showing ([#151](https://github.com/starkware-libs/starkgate-frontend/issues/151)) ([017ce0a](https://github.com/starkware-libs/starkgate-frontend/commit/017ce0a9a86942233cbc0d6affcaecc309714ac5)) --- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f7b30d..87483449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## [1.2.0](https://github.com/starkware-libs/starkgate-frontend/compare/v1.1.0...v1.2.0) (2022-04-13) + + +### 🧩 Features + +* terms of use ([#141](https://github.com/starkware-libs/starkgate-frontend/issues/141)) ([8d9fe79](https://github.com/starkware-libs/starkgate-frontend/commit/8d9fe7957e09c739e1e79801eaf507178854f944)) + + +### πŸ”§ Fixes + +* app crashed when trying to connect while ArgentX wasn't installed ([74e6861](https://github.com/starkware-libs/starkgate-frontend/commit/74e6861e3a7c00623e83fcfecfb0fcafbfc4a89e)) +* **Faq:** update question 8 ([#149](https://github.com/starkware-libs/starkgate-frontend/issues/149)) ([67f50f7](https://github.com/starkware-libs/starkgate-frontend/commit/67f50f762639e272676da2779a959690d0809a38)) +* **Terms:** add notes ([#144](https://github.com/starkware-libs/starkgate-frontend/issues/144)) ([b007f3e](https://github.com/starkware-libs/starkgate-frontend/commit/b007f3e2593b7f61716fc467ab5ce0b266ba0ba1)) +* unsupported chain id does not showing ([#151](https://github.com/starkware-libs/starkgate-frontend/issues/151)) ([017ce0a](https://github.com/starkware-libs/starkgate-frontend/commit/017ce0a9a86942233cbc0d6affcaecc309714ac5)) + ## [1.2.0-dev.5](https://github.com/starkware-libs/starkgate-frontend/compare/v1.2.0-dev.4...v1.2.0-dev.5) (2022-04-13) diff --git a/package.json b/package.json index 0e9e6fc4..e26c1406 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starkgate-frontend", - "version": "1.2.0-dev.5", + "version": "1.2.0", "homepage": "./", "scripts": { "clean": "rm -rf ./dist", From fa54c98f37ce2b9719911e33827339f9f17293c8 Mon Sep 17 00:00:00 2001 From: Dan Ziv Date: Thu, 14 Apr 2022 18:51:42 +0300 Subject: [PATCH 29/31] change branches --- .github/workflows/push_frontend_images.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_frontend_images.yml b/.github/workflows/push_frontend_images.yml index a8861eff..c0571699 100644 --- a/.github/workflows/push_frontend_images.yml +++ b/.github/workflows/push_frontend_images.yml @@ -16,15 +16,30 @@ jobs: gcp_token: ${{ secrets.STARKGATE_SA }} deploy_devnet: - if: github.event.base_ref == 'refs/heads/guy/master/dev_helm_deployment' + if: github.event.base_ref == 'refs/heads/dev' needs: [push-frontend-image] uses: ./.github/workflows/helm_upgrade_workflow.yml with: app_name: starkgate - namespace_name: starkgate-devnet-guy + namespace_name: starkgate-devnet values_file: deployment/development.yml env_file: .env.testing secrets: gcp_token: ${{ secrets.STARKGATE_SA }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + + deploy_testnet: + if: github.event.base_ref == 'refs/heads/master' + needs: [push-frontend-image] + uses: ./.github/workflows/helm_upgrade_workflow.yml + with: + app_name: starkgate + namespace_name: starkgate-goerli + values_file: deployment/testing.yml + env_file: .env.testing + secrets: + gcp_token: ${{ secrets.STARKGATE_SA }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 452bd2a2740c3018430b09a2d6384616de5d757a Mon Sep 17 00:00:00 2001 From: Dan Ziv Date: Mon, 18 Apr 2022 13:42:29 +0300 Subject: [PATCH 30/31] Delete Terms.strings.js --- src/routes/Terms/Terms.strings.js | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 src/routes/Terms/Terms.strings.js diff --git a/src/routes/Terms/Terms.strings.js b/src/routes/Terms/Terms.strings.js deleted file mode 100644 index d1a97750..00000000 --- a/src/routes/Terms/Terms.strings.js +++ /dev/null @@ -1,9 +0,0 @@ -import utils from '../../utils'; - -const {title_txt, accept_btn_txt, last_revised_txt, notes_title_txt} = - utils.getTranslation('screens.terms'); - -export const TITLE_TXT = title_txt; -export const ACCEPT_BTN_TXT = accept_btn_txt; -export const LAST_REVISED_TXT = last_revised_txt; -export const NOTES_TITLE_TXT = notes_title_txt; From 680830d0aadc235406b0d7a49d3cba9e1da6c887 Mon Sep 17 00:00:00 2001 From: Dan Ziv Date: Thu, 21 Apr 2022 23:59:27 +0300 Subject: [PATCH 31/31] Update Terms.module.scss --- src/routes/Terms/Terms.module.scss | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/routes/Terms/Terms.module.scss b/src/routes/Terms/Terms.module.scss index 28a62293..85d26c84 100644 --- a/src/routes/Terms/Terms.module.scss +++ b/src/routes/Terms/Terms.module.scss @@ -19,27 +19,6 @@ font-size: 24px; font-weight: bold; } - - .notes { - h3 { - margin-bottom: 0; - line-height: 1; - margin-top: 50px; - } - - hr { - border-color: $--color-white; - } - - li { - margin-bottom: 4px; - - &::marker { - font-size: 16px; - font-weight: normal; - } - } - } } .acceptButton {