From 55cac3d79b747e8d3d4bfeb0561349346d655747 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 20:57:04 -0700 Subject: [PATCH 1/8] feat: docker-compose --- docker-compose.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9b8ba37 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.1' + +services: + + mongo: + image: mongo + restart: always + ports: + - 27017:27017 + + mongo-express: + image: mongo-express + restart: always + ports: + - 8081:8081 + environment: + ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/ From 7739d183bee6a305eda187c47eb8333ca96b3a90 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 20:57:59 -0700 Subject: [PATCH 2/8] build(env): update config --- example.env | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/example.env b/example.env index 36b8b87..cd020d3 100644 --- a/example.env +++ b/example.env @@ -21,6 +21,8 @@ CORS_ORIGIN='' GAS_STATION_API_URL='' BLOCKNATIVE_API_URL='' +CHAIN_ID=0x1 + UNIV2="0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" UNIV3="0xE592427A0AEce92De3Edee1F18E0157C05861564" SUSHIV2="0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F" @@ -47,9 +49,3 @@ KYBER="https://api.kyber.network/tokenlist" MYCRYPTOAPI="https://uniswap.mycryptoapi.com/" ZAPPER="https://zapper.fi/api/token-list" ZERION="https://tokenlist.zerion.eth.link" - -# Heroku -# cant run on free tier more than 20 days of the month -#HEROKU_APP_NAME_CONFIRMED_WORKER='' -#HEROKU_APP_NAME_PENDING_WORKER='' -#HEROKU_APP_NAME_WEBSOCKET_WORKER='' From c97e5551051b77ff40d19d4bcb38278332f0d643 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 21:00:59 -0700 Subject: [PATCH 3/8] build(ts): esnext --- tsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index a021324..11423e3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "./node_modules/gts/tsconfig-google.json", "compilerOptions": { + "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "esModuleInterop": true, "declaration": true, @@ -12,9 +13,11 @@ "sourceMap": true, "strict": true, "skipLibCheck": true + "target": "es2020", + "module": "esnext", }, "include": [ "src/**/*.ts" ], "exclude": ["test", "node_modules"] -} \ No newline at end of file +} From 015beec4b4b148c374ecfde329fe14d79ca32929 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 21:02:44 -0700 Subject: [PATCH 4/8] build(package): update manifest --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 7b26bd1..f244040 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mempool-shark", "private": false, - "version": "0.2.1", + "version": "0.3.0", "author": "SEE CONTRIBUTORS", "engines": { "node": ">=14.0.0" @@ -23,7 +23,6 @@ "dev:mempool": "npx ts-node-dev ./src/listener-mempool.ts", "dev:confirm": "npx ts-node-dev ./src/listener-confirmation.ts", "dev:ws": "npx ts-node-dev ./src/_websocket-server.ts", - "init:heroku": "npx ts-node ./src/utils/initServer/set-heroku.ts", "reset:hard": "npx ts-node ./src/utils/dev-utils/drop-transactions.ts", "reset:txs": "npx ts-node ./src/utils/dev-utils/reset-transactions.ts", "reset:txc": "npx ts-node ./src/utils/dev-utils/reset-transactions-c.ts", From 09e9880067726cfebc445b7b3ce05617d733025c Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 21:03:25 -0700 Subject: [PATCH 5/8] ci(workflows): refactor nodejs pipeline --- .github/workflows/nodejs.yml | 47 +++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d710dec..d370f8b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,37 +1,50 @@ -# CI for command line NodeJS Applications name: nodejs -on: + +on: push: paths: - "**/**" - "!**/*.md/**" - env: - CI: true + COMMIT_SHA: ${{ github.event.pull_request.head.sha }} + PULL_NUMBER: ${{ github.event.pull_request.number }} + RUN_ID: ${{ github.run_id }} FORCE_COLOR: 2 jobs: - run: - name: Node ${{ matrix.node }} on ${{ matrix.os }} + pipeline: + name: Node ${{ matrix.node-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - node: ['14'] + node-version: ['16.x'] os: ['ubuntu-latest'] steps: - - name: Clone repository - uses: actions/checkout@v2.3.4 - - - name: Set up Node.js - uses: actions/setup-node@v2.1.5 + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} - - name: Install npm dependencies - run: npm install + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install project dependencies + run: yarn --prefer-offline + id: install - - name: Run build - run: npm run build + - name: Install project dependencies + run: yarn run build + id: build From bfab5f75b0fc618a7d8ba319ac97028478f512f4 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 21:04:02 -0700 Subject: [PATCH 6/8] fix(ts): resolution --- tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 11423e3..366bede 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,6 @@ "extends": "./node_modules/gts/tsconfig-google.json", "compilerOptions": { "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, "esModuleInterop": true, "declaration": true, "declarationMap": true, From 4c8b40e3d90c0d952eca65f95abdf079102b45f1 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 21:05:30 -0700 Subject: [PATCH 7/8] fix(config): defect --- tsconfig.json | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 366bede..e696026 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,22 +1,22 @@ { - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "declaration": true, - "declarationMap": true, - "importHelpers": true, - "downlevelIteration": true, - "rootDir": "./src", - "outDir": "./lib", - "sourceMap": true, - "strict": true, - "skipLibCheck": true - "target": "es2020", - "module": "esnext", - }, - "include": [ - "src/**/*.ts" - ], - "exclude": ["test", "node_modules"] + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "declaration": true, + "declarationMap": true, + "importHelpers": true, + "downlevelIteration": true, + "rootDir": "./src", + "outDir": "./lib", + "sourceMap": true, + "strict": true, + "skipLibCheck": true, + "target": "es2020", + "module": "esnext" + }, + "include": [ + "src/**/*.ts" + ], + "exclude": ["test", "node_modules"] } From 7b0d55388ac268f02ef83a32f12061e99889203e Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 8 Apr 2022 21:07:25 -0700 Subject: [PATCH 8/8] target: es2020 --- tsconfig.json | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index e696026..c0c267b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,22 +1,21 @@ { - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "declaration": true, - "declarationMap": true, - "importHelpers": true, - "downlevelIteration": true, - "rootDir": "./src", - "outDir": "./lib", - "sourceMap": true, - "strict": true, - "skipLibCheck": true, - "target": "es2020", - "module": "esnext" - }, - "include": [ - "src/**/*.ts" - ], - "exclude": ["test", "node_modules"] + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "resolveJsonModule": true, + "esModuleInterop": true, + "declaration": true, + "declarationMap": true, + "importHelpers": true, + "downlevelIteration": true, + "rootDir": "./src", + "outDir": "./lib", + "sourceMap": true, + "strict": true, + "target": "es2020", + "skipLibCheck": true + }, + "include": [ + "src/**/*.ts" + ], + "exclude": ["test", "node_modules"] }