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 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/ 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='' 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", diff --git a/tsconfig.json b/tsconfig.json index a021324..c0c267b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,10 +11,11 @@ "outDir": "./lib", "sourceMap": true, "strict": true, + "target": "es2020", "skipLibCheck": true }, "include": [ "src/**/*.ts" ], "exclude": ["test", "node_modules"] -} \ No newline at end of file +}