From d26d105477b543a70757e5a2d6bc1c68aa46428d Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 13:57:12 +0100 Subject: [PATCH 01/19] update --- .../dependencies/nodejs/package.json | 3 +++ packages/transaction-trace-provider/package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/transaction-trace-provider/dependencies/nodejs/package.json b/packages/transaction-trace-provider/dependencies/nodejs/package.json index c315dccf..5877e79d 100644 --- a/packages/transaction-trace-provider/dependencies/nodejs/package.json +++ b/packages/transaction-trace-provider/dependencies/nodejs/package.json @@ -2,6 +2,9 @@ "dependencies": { "hardhat": "npm:@rumblefishdev/hardhat@0.19.104" }, + "overrides": { + "hardhat@^2.9.5": "hardhat" + }, "scripts": { } } diff --git a/packages/transaction-trace-provider/package.json b/packages/transaction-trace-provider/package.json index fefe58ac..6c0ad9f4 100644 --- a/packages/transaction-trace-provider/package.json +++ b/packages/transaction-trace-provider/package.json @@ -17,6 +17,7 @@ "hardhat@^2.9.5": "hardhat" }, "scripts": { + "postinstall": "cp -R node_modules ./dependencies/nodejs/node_modules", "build": "esbuild hardhat.config.ts src/* --bundle --external:hardhat --loader:.node=file --sourcemap --minify --target=node18.5 --target=es2020 --platform=node --format=cjs --outdir=dist", "unit": "jest", "unit-watch": "jest --watch", From 42993cadbcfd606836b1de91c133123a6a043bed Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 15:13:40 +0100 Subject: [PATCH 02/19] test build --- .github/workflows/deploy-stage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 35b9fd6d..4fa6170e 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -122,6 +122,9 @@ jobs: - name: Build run: | npm run types:build + - name: Build Docker Image + run: | + docker build -t current ./packages/transaction-trace-provider - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 with: From b1321315ff51e59a0179980b72d2c5011fff30f5 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 15:25:41 +0100 Subject: [PATCH 03/19] test --- .github/workflows/deploy-stage.yml | 14 ++++++++++++-- package.json | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 4fa6170e..cb40306c 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -100,6 +100,10 @@ jobs: - name: 'Checkout' uses: actions/checkout@v2.3.1 + - name: Extract version from tag + id: extract_version + run: echo "::set-output name=VERSION::${GITHUB_REF#refs/tags/@evm-debuger/transaction-trace@}" + - uses: actions/setup-node@master with: node-version: ${{ env.NODE_VERSION }} @@ -124,14 +128,20 @@ jobs: npm run types:build - name: Build Docker Image run: | - docker build -t current ./packages/transaction-trace-provider + npm run transaction-trace-provider:build + docker build -t 428196107266.dkr.ecr.us-east-1.amazonaws.com/transaction-trace-provider:v${{ steps.extract_version.outputs.VERSION }} ./packages/transaction-trace-provider - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 with: role-to-assume: arn:aws:iam::428196107266:role/evm-debugger-transaction-trace-deploy-stage aws-region: us-east-1 role-session-name: ${{ github.event.repository.name }}-${{ github.job }} - + - name: ECR login + run: | + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 428196107266.dkr.ecr.us-east-1.amazonaws.com + - name: Push image + run: | + docker push 428196107266.dkr.ecr.us-east-1.amazonaws.com/transaction-trace-provider:v${{ steps.extract_version.outputs.VERSION }} - name: Deploy stack working-directory: ./packages/infra run: | diff --git a/package.json b/package.json index 523fdf27..a081139a 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "transaction-trace-api:lint-fix": "lerna run lint:fix --scope @evm-debuger/transaction-trace-api", "transaction-trace-provider:lint-check": "lerna run lint:check --scope @evm-debuger/transaction-trace-provider", "transaction-trace-provider:lint-fix": "lerna run lint:fix --scope @evm-debuger/transaction-trace-provider", + "transaction-trace-provider:build": "lerna run build --scope @evm-debuger/transaction-trace-provider", "types:build": "lerna run build --scope @evm-debuger/types" }, "devDependencies": { From 65d41ad784edff2205c66f6c5664eb0e2920f43b Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 15:40:18 +0100 Subject: [PATCH 04/19] update --- .github/workflows/deploy-stage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index cb40306c..9ea1d6e5 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -107,6 +107,8 @@ jobs: - uses: actions/setup-node@master with: node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://npm.pkg.github.com' + scope: "@rumblefishdev" - name: 'Cache NPM dependencies' uses: pat-s/always-upload-cache@v2.1.5 @@ -164,6 +166,8 @@ jobs: - uses: actions/setup-node@master with: node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://npm.pkg.github.com' + scope: "@rumblefishdev" - name: 'Cache NPM dependencies' uses: pat-s/always-upload-cache@v2.1.5 From 706fc1eb58138b5a74772f87a24a34a16e419deb Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 15:47:38 +0100 Subject: [PATCH 05/19] update --- .github/workflows/deploy-stage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 9ea1d6e5..5ced300d 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -124,6 +124,8 @@ jobs: npm i npm install jq.node -g node_modules/.bin/lerna bootstrap + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Build run: | @@ -183,6 +185,8 @@ jobs: npm i npm install jq.node -g node_modules/.bin/lerna bootstrap + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Build run: | From 1b6259c0d2f9826c0d2af4e40e9fd32ecd9c87e2 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 16:03:42 +0100 Subject: [PATCH 06/19] update --- packages/infra/ci-roles.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/packages/infra/ci-roles.yml b/packages/infra/ci-roles.yml index 896d83b8..7f006643 100644 --- a/packages/infra/ci-roles.yml +++ b/packages/infra/ci-roles.yml @@ -72,6 +72,39 @@ Resources: token.actions.githubusercontent.com:sub: !Sub repo:rumblefishdev/${RepositoryName}:* Path: "/" Policies: + - PolicyName: allow-ci-to-use-ecr + PolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Action: + - ecr:* + Resource: + - '*' + - Effect: Allow + Action: + - apigateway:* + - cloudformation:* + - dynamodb:* + - sqs:Get* + - sqs:List* + - sqs:SetQueueAttributes + - iam:GetRole + - iam:PutRolePolicy + - lambda:UpdateFunctionCode + - lambda:TagResource + - lambda:GetLayerVersion + - lambda:UpdateEventSourceMapping + - lambda:GetEventSourceMapping + - lambda:ListTags + - lambda:PublishLayerVersion + - lambda:UpdateFunctionConfiguration + - lambda:CreateFunction + - ssm:GetParameter + - ssm:GetParameters + - iam:PassRole + - ssm:AddTagsToResource + Resource: "*" - PolicyName: allow-ci-to-update-transactiontrace PolicyDocument: Version: "2012-10-17" From 0b98593f7d1ee62fe18de67d26d0300de385a7ea Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 16:07:35 +0100 Subject: [PATCH 07/19] updejt --- packages/transaction-trace-provider/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/transaction-trace-provider/package.json b/packages/transaction-trace-provider/package.json index 6c0ad9f4..b0499fe1 100644 --- a/packages/transaction-trace-provider/package.json +++ b/packages/transaction-trace-provider/package.json @@ -17,7 +17,7 @@ "hardhat@^2.9.5": "hardhat" }, "scripts": { - "postinstall": "cp -R node_modules ./dependencies/nodejs/node_modules", + "postinstall": "cd ./dependencies/nodejs && npm i", "build": "esbuild hardhat.config.ts src/* --bundle --external:hardhat --loader:.node=file --sourcemap --minify --target=node18.5 --target=es2020 --platform=node --format=cjs --outdir=dist", "unit": "jest", "unit-watch": "jest --watch", From 8bd3828c20eb68d79b7fa8c869f990b2be1dcb30 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Wed, 14 Feb 2024 16:35:22 +0100 Subject: [PATCH 08/19] test --- packages/transaction-trace-provider/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/transaction-trace-provider/package.json b/packages/transaction-trace-provider/package.json index b0499fe1..ea3fe5df 100644 --- a/packages/transaction-trace-provider/package.json +++ b/packages/transaction-trace-provider/package.json @@ -17,7 +17,7 @@ "hardhat@^2.9.5": "hardhat" }, "scripts": { - "postinstall": "cd ./dependencies/nodejs && npm i", + "postinstall": "cd dependencies/nodejs && npm install", "build": "esbuild hardhat.config.ts src/* --bundle --external:hardhat --loader:.node=file --sourcemap --minify --target=node18.5 --target=es2020 --platform=node --format=cjs --outdir=dist", "unit": "jest", "unit-watch": "jest --watch", From a753affef2eded24eef263f1157d4b159ed0450d Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 10:10:11 +0100 Subject: [PATCH 09/19] update --- .../frontend/src/store/transactionInfo/transactionInfo.utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend/src/store/transactionInfo/transactionInfo.utils.ts b/packages/frontend/src/store/transactionInfo/transactionInfo.utils.ts index e5d04b67..fd01999d 100644 --- a/packages/frontend/src/store/transactionInfo/transactionInfo.utils.ts +++ b/packages/frontend/src/store/transactionInfo/transactionInfo.utils.ts @@ -4,6 +4,7 @@ import { toBeHex, toNumber } from 'ethers' import type { TEthersTransactionReposnse } from './transactionInfo.types' export const formatTransactionReposne = (transactionInfo: TEthersTransactionReposnse): TTransactionInfo => { + console.log(transactionInfo) const formattedTransactionInfo: TTransactionInfo = { value: toBeHex(transactionInfo.value), to: transactionInfo.to, From 4c2c8ed6060b86a0dbcea9bcca89b811596325d6 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 10:14:40 +0100 Subject: [PATCH 10/19] update --- packages/transaction-trace-provider/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/transaction-trace-provider/package.json b/packages/transaction-trace-provider/package.json index ea3fe5df..1349fc2b 100644 --- a/packages/transaction-trace-provider/package.json +++ b/packages/transaction-trace-provider/package.json @@ -17,7 +17,7 @@ "hardhat@^2.9.5": "hardhat" }, "scripts": { - "postinstall": "cd dependencies/nodejs && npm install", + "postinstall": "npm --prefix dependencies/nodejs install", "build": "esbuild hardhat.config.ts src/* --bundle --external:hardhat --loader:.node=file --sourcemap --minify --target=node18.5 --target=es2020 --platform=node --format=cjs --outdir=dist", "unit": "jest", "unit-watch": "jest --watch", From b3ec84356cd0966def18f597b8e86aa9a7afd990 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 10:27:13 +0100 Subject: [PATCH 11/19] test --- .github/workflows/deploy-stage.yml | 1 + packages/transaction-trace-provider/package.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 5ced300d..fd63a295 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -124,6 +124,7 @@ jobs: npm i npm install jq.node -g node_modules/.bin/lerna bootstrap + npm --prefix packages/transaction-trace-provider/dependencies/nodejs install env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/packages/transaction-trace-provider/package.json b/packages/transaction-trace-provider/package.json index 1349fc2b..fefe58ac 100644 --- a/packages/transaction-trace-provider/package.json +++ b/packages/transaction-trace-provider/package.json @@ -17,7 +17,6 @@ "hardhat@^2.9.5": "hardhat" }, "scripts": { - "postinstall": "npm --prefix dependencies/nodejs install", "build": "esbuild hardhat.config.ts src/* --bundle --external:hardhat --loader:.node=file --sourcemap --minify --target=node18.5 --target=es2020 --platform=node --format=cjs --outdir=dist", "unit": "jest", "unit-watch": "jest --watch", From 787aaf682cc2f019023de195c8f96d96e7e34b82 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 10:42:22 +0100 Subject: [PATCH 12/19] update --- .github/workflows/deploy-stage.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index fd63a295..5946d652 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -107,8 +107,6 @@ jobs: - uses: actions/setup-node@master with: node-version: ${{ env.NODE_VERSION }} - registry-url: 'https://npm.pkg.github.com' - scope: "@rumblefishdev" - name: 'Cache NPM dependencies' uses: pat-s/always-upload-cache@v2.1.5 From 63b60fb736d13ffafbaaaed8f5b16eab6e3db444 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 11:05:58 +0100 Subject: [PATCH 13/19] test --- .github/workflows/deploy-stage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 5946d652..fd63a295 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -107,6 +107,8 @@ jobs: - uses: actions/setup-node@master with: node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://npm.pkg.github.com' + scope: "@rumblefishdev" - name: 'Cache NPM dependencies' uses: pat-s/always-upload-cache@v2.1.5 From 3f3a30f8b176c2b179477db1b5363827b3285cc5 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 12:04:06 +0100 Subject: [PATCH 14/19] updejt --- .github/workflows/deploy-stage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index fd63a295..739cf594 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -35,6 +35,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} registry-url: 'https://npm.pkg.github.com' scope: "@rumblefishdev" + NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} - name: 'Cache NPM dependencies' uses: pat-s/always-upload-cache@v2.1.5 From 29829381c84c9096b5262fdfab65ed2015ec2afc Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Thu, 15 Feb 2024 12:10:02 +0100 Subject: [PATCH 15/19] updejt --- .github/workflows/deploy-stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 739cf594..c518df04 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -51,7 +51,7 @@ jobs: npm i node_modules/.bin/lerna bootstrap env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} - name: 'Build' run: | From 9e198b8442a7a5f91f94178f0bbb0d0734f369a5 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Fri, 16 Feb 2024 13:43:46 +0100 Subject: [PATCH 16/19] test --- .github/workflows/deploy-stage.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index c518df04..786267ea 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -5,6 +5,10 @@ on: types: - created +permissions: + contents: read + packages: read + env: NODE_VERSION: 18.16.0 ENV: stage @@ -51,7 +55,7 @@ jobs: npm i node_modules/.bin/lerna bootstrap env: - NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: 'Build' run: | From 9cc5098cc2e6d185bf56078634888a94ce1c2cba Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Fri, 16 Feb 2024 13:50:42 +0100 Subject: [PATCH 17/19] test --- .github/workflows/deploy-stage.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 786267ea..4f26a9c7 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -5,10 +5,6 @@ on: types: - created -permissions: - contents: read - packages: read - env: NODE_VERSION: 18.16.0 ENV: stage @@ -29,6 +25,7 @@ jobs: permissions: id-token: write contents: read + packages: read steps: - name: 'Checkout' From 609021d88445b2c1f957c5766e6d040c6795dd4b Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Fri, 16 Feb 2024 13:59:17 +0100 Subject: [PATCH 18/19] test --- .github/workflows/deploy-stage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index 4f26a9c7..e505d9ac 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -98,6 +98,7 @@ jobs: permissions: id-token: write contents: read + packages: read steps: - name: 'Checkout' uses: actions/checkout@v2.3.1 From 858effc542cf9fadd75a85237f90a598ae91c9a9 Mon Sep 17 00:00:00 2001 From: Piotr Sierankiewicz Date: Fri, 16 Feb 2024 14:05:08 +0100 Subject: [PATCH 19/19] test --- .github/workflows/deploy-stage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-stage.yml b/.github/workflows/deploy-stage.yml index e505d9ac..c5f97e15 100644 --- a/.github/workflows/deploy-stage.yml +++ b/.github/workflows/deploy-stage.yml @@ -112,6 +112,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} registry-url: 'https://npm.pkg.github.com' scope: "@rumblefishdev" + NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} - name: 'Cache NPM dependencies' uses: pat-s/always-upload-cache@v2.1.5 @@ -129,7 +130,7 @@ jobs: node_modules/.bin/lerna bootstrap npm --prefix packages/transaction-trace-provider/dependencies/nodejs install env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} - name: Build run: |