Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: rebase integration tests to main #167

Merged
merged 125 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
7251662
fix: update tokeninfo API description (#124)
Romsters Dec 13, 2023
539dd08
feat: deprecate warning for goerli (#126)
vasyl-ivanchuk Dec 15, 2023
5c7a8bf
fix: show issues banner on mainnet (tmp) (#128)
Romsters Dec 16, 2023
ad9b1dd
fix: improve indexing status badge (#129)
vasyl-ivanchuk Dec 16, 2023
6249b3d
feat: add remote config for indexer (tmp) (#130)
Romsters Dec 16, 2023
e70f81b
fix: header height when warning message is shown (#132)
vasyl-ivanchuk Dec 16, 2023
1a71d1f
fix: remove mainnet warning (#133)
vasyl-ivanchuk Dec 17, 2023
db218a4
fix: don't save tokens whose symbols contain only special characters …
vasyl-ivanchuk Dec 19, 2023
c53253e
fix: don't do prefetch request for tx search (#135)
vasyl-ivanchuk Dec 19, 2023
8f664de
feat: use websockets to fetch transactions (tmp) (#136)
Romsters Dec 19, 2023
6f6e34d
fix: initialise websockets provider only when enabled (#137)
Romsters Dec 19, 2023
cba9b03
fix: use websockets for balances (tmp) (#138)
Romsters Dec 19, 2023
3f2f078
fix: add mainnet warning (tmp) (#139)
vasyl-ivanchuk Dec 19, 2023
800fc2f
feat: use multiple db transactions for blocks processing, use websock…
Romsters Dec 20, 2023
64c1026
feat: automatic system alerts (#141)
Romsters Dec 22, 2023
82491ac
fix: tests for unit of work changes (#144)
Romsters Jan 3, 2024
14a235f
chore: fix dev discussions link (#143)
dutterbutter Jan 3, 2024
0c0c6bf
test: add allure public reports (#68)
pcheremu Jan 3, 2024
f0a30db
fix: docs links (#150)
vasyl-ivanchuk Jan 16, 2024
7c8cab5
feat: add data fetcher service (#145)
vasyl-ivanchuk Jan 18, 2024
0c6232a
fix: remove portal from header (#159)
vasyl-ivanchuk Feb 6, 2024
7347c9b
fix: add data fetcher debug logs (#165)
vasyl-ivanchuk Feb 7, 2024
040507e
feat: integration tests setup (#45)
Romsters Oct 10, 2023
c9ead88
test: add an .env.example file with description to integration-tests
pcheremu Oct 18, 2023
b9dc1ff
test: adding a default action for hardhat
pcheremu Oct 18, 2023
09a89dd
test: fix path to env
pcheremu Oct 19, 2023
3128b79
test: exclude file existence check
pcheremu Oct 19, 2023
a492033
test: create a fallback case for a default wallet
pcheremu Oct 19, 2023
db8157f
test: refactoring
pcheremu Oct 19, 2023
c748793
test: restructure test solution
abilevych Oct 24, 2023
b328260
test: the tokens API-related suite re-structuring
abilevych Oct 24, 2023
39891f9
test: the address API-related suite re-structuring
abilevych Oct 25, 2023
715db9e
test: the transaction API-related suite re-structuring
abilevych Oct 26, 2023
cb29a88
chore: run lint
abilevych Oct 31, 2023
98dac7f
test: re-structure test suites for batches, stats, blocks endpoints
abilevych Oct 31, 2023
43575a2
chore: group the SDK-related test suites as pre-requisites
abilevych Nov 1, 2023
f07eb63
chore: hooks / aligning tests suites
abilevych Nov 1, 2023
b71e2b4
chore: implemented a global hook for jest
abilevych Nov 3, 2023
43c6812
chore: local hooks for the addresses endpoint
abilevych Nov 3, 2023
4052d79
chore: local hooks for the tokens endpoint
abilevych Nov 3, 2023
d698957
chore: local hooks for the transaction endpoint
abilevych Nov 3, 2023
1a02897
chore: add global hooks
abilevych Nov 6, 2023
3485efe
chore: fix after lint
abilevych Nov 6, 2023
2576a6a
chore: changed timeouts in addresses api suite
abilevych Nov 7, 2023
890463c
chore: optimized addresses/transactions test suites
abilevych Nov 7, 2023
39d566f
test: test with a cache
pcheremu Nov 9, 2023
89a4e97
test: test with a cleaned cache in advance
pcheremu Nov 9, 2023
b2377ce
test: test with a cache
pcheremu Nov 9, 2023
083dd06
test: refactoring
pcheremu Nov 9, 2023
8199cb2
test: remove an issue workaround for husky
pcheremu Nov 9, 2023
cc17eaf
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
94dde45
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 17, 2023
023b679
test: covering Contract API and Logs API endpoints
amelnytskyi Nov 21, 2023
34a6694
feat: integration tests setup (#45)
Romsters Oct 10, 2023
59e508c
test: restructure test solution
abilevych Oct 24, 2023
e9c3f24
test: the tokens API-related suite re-structuring
abilevych Oct 24, 2023
c04df2d
test: the address API-related suite re-structuring
abilevych Oct 25, 2023
9434859
test: the transaction API-related suite re-structuring
abilevych Oct 26, 2023
a9df827
chore: run lint
abilevych Oct 31, 2023
1433aff
test: re-structure test suites for batches, stats, blocks endpoints
abilevych Oct 31, 2023
86f69e5
chore: group the SDK-related test suites as pre-requisites
abilevych Nov 1, 2023
0a334a0
chore: hooks / aligning tests suites
abilevych Nov 1, 2023
c16ff0f
chore: implemented a global hook for jest
abilevych Nov 3, 2023
db10fb8
chore: add global hooks
abilevych Nov 6, 2023
d4061fe
test: test with a cache
pcheremu Nov 9, 2023
2b22cf8
test: test with a node
pcheremu Nov 9, 2023
88f075d
test: test with a cleaned cache in advance
pcheremu Nov 9, 2023
5b32df1
test: test with a cache
pcheremu Nov 9, 2023
6b7426d
test: refactoring
pcheremu Nov 9, 2023
b91ce23
test: remove an issue workaround for husky
pcheremu Nov 9, 2023
62fc07b
Small refactoring artifactsSet3.feature
pcheremu Dec 14, 2023
3e0e571
test: prepare run api tests on ci
pcheremu Dec 15, 2023
67e517b
test: refactoring
pcheremu Dec 15, 2023
450465e
test: update name in integration-tests-api.yml
pcheremu Dec 18, 2023
eb849f3
test: initial commit with tests
pcheremu Jan 5, 2024
229bcea
test: eslint refactoring
pcheremu Jan 5, 2024
570636b
test: updated contract hash for ui test
pcheremu Jan 5, 2024
834c183
test: refactoring
pcheremu Jan 5, 2024
f5f40e0
test: refactoring
pcheremu Jan 5, 2024
e7a6880
test: fix unstable api test
pcheremu Jan 5, 2024
049d436
test: fix git ignore output folders
pcheremu Jan 5, 2024
1fc3188
test: refactoring
pcheremu Jan 5, 2024
e3adb37
test: refactoring test name
pcheremu Jan 5, 2024
efb824a
test: refactoring test name
pcheremu Jan 5, 2024
5c836a9
tests: refactoring test names
pcheremu Jan 10, 2024
ccd43ef
test: refactoring eslint
pcheremu Jan 10, 2024
47ff69d
test: refactoring names
pcheremu Jan 10, 2024
4f607a6
test: fix api tests
pcheremu Jan 10, 2024
d529614
test: refactoring
pcheremu Jan 10, 2024
1b52e74
test: refactoring
pcheremu Jan 10, 2024
323c044
test: refactoring
pcheremu Jan 10, 2024
9ddac3f
test: refactoring after rebase
pcheremu Jan 10, 2024
e5166fb
test: refactoring eslint
pcheremu Jan 10, 2024
985f775
test: fix test names add account test to the workflow
pcheremu Jan 11, 2024
4743f53
test: refactoring
pcheremu Jan 17, 2024
d2139a9
Update packages/integration-tests/tests/api/accounts.test.ts
pcheremu Jan 18, 2024
1197e8c
chore: update the Blocks suite name
abilevych Jan 18, 2024
63632ed
test: fix names in tests
pcheremu Jan 18, 2024
0305964
test: refactoring
pcheremu Jan 18, 2024
3154ce4
chore: api retry logic for tests
abilevych Jan 11, 2024
179ad6d
fix: lint issues
abilevych Jan 11, 2024
b3d3570
chore: changed timeouts
abilevych Jan 16, 2024
fce6b68
chore: integration api tests refactoring
abilevych Jan 17, 2024
edd9f41
chore: excluded unstable test
abilevych Jan 17, 2024
529db23
chore: jest retry option, fix lint
abilevych Jan 17, 2024
aa52599
chore: refactoring test actualization after rebase
abilevych Jan 18, 2024
e6a9a6d
fix: lint issue
abilevych Jan 18, 2024
2840d27
chore: exclude gating test
abilevych Jan 18, 2024
bb213fc
chore: excluded unstable tests
abilevych Jan 18, 2024
e1a9ded
chore: updated retry-logic for integration api tests
abilevych Jan 23, 2024
19ce1d5
fix: integration api tests for the CI run
abilevych Jan 23, 2024
76a2853
chore: refactoring leftovers in the test solution
abilevych Jan 23, 2024
df98035
chore: optimized integration API tests
abilevych Jan 23, 2024
0ac272b
chore: refactored jest config
abilevych Jan 23, 2024
fc5981c
chore: refactoring test retry method
abilevych Jan 24, 2024
6cbb1f6
test: covering tokens API endpoints tc1803 (#155)
amelnytskyi Jan 30, 2024
99acf86
test: fix readme docker command (#158)
pcheremu Jan 30, 2024
59bf62a
test: covering Batches API and partially covered Transactions (#156)
amelnytskyi Jan 30, 2024
40365f0
feat: new automation tests for accounts API (#163)
olehbairak Feb 6, 2024
c3d5b60
test: fixing gating transactions tests (#162)
amelnytskyi Feb 7, 2024
c171b12
test: fix after rebase
pcheremu Feb 9, 2024
2722700
test: fix files after rebase
pcheremu Feb 9, 2024
ec09dfa
Merge branch 'integration-tests' into QA-657-rebase-test4
pcheremu Feb 9, 2024
323a0a9
test: update package-lock
pcheremu Feb 9, 2024
bf16f2a
test: fix for redirection ui tests
pcheremu Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/dist/
**/dist/
**.env
2 changes: 1 addition & 1 deletion .github/workflows/app-deploy-feature-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: ./.github/workflows/app-e2e.yml
secrets: inherit
permissions:
contents: read
contents: write
with:
targetUrl: ${{ needs.build.outputs.dappUrl }}
testnet_network_value_for_e2e: "/?network=sepolia"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/app-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
uses: ./.github/workflows/app-e2e.yml
secrets: inherit
permissions:
contents: read
contents: write
with:
targetUrl: ${{ needs.deploy.outputs.dappUrl }}
testnet_network_value_for_e2e: "/?network=sepolia"
Expand Down
69 changes: 48 additions & 21 deletions .github/workflows/app-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ jobs:
uses: actions/cache@v3
env:
cache-name: cache-node-modules
# Workaround for bug https://github.com/typicode/husky/issues/991
HUSKY: 0
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
Expand Down Expand Up @@ -116,27 +114,21 @@ jobs:
E2ENETWORK='${{ inputs.default_network_value_for_e2e }}' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @testnet"
fi

- name: Reset tags quotes
- name: Save artifacts to Git
if: always()
run: |
echo "MATRIX_TAG_WITHOUT_QUOTES=$(echo ${{ matrix.tags }} | sed -e 's/@//g' )" >> $GITHUB_ENV
uses: actions/upload-artifact@v3
with:
name: allure-results
path: packages/app/allure-results

- name: Create launch ID
- name: Upload test results to Allure reporter
if: always()
env:
ALLURE_LAUNCH_NAME: "#${{ github.run_number }} ${{ env.MATRIX_TAG_WITHOUT_QUOTES }}"
ALLURE_LAUNCH_TAGS: "${{ env.ALLURE_BASIC_TAGS }}, ${{ env.MATRIX_TAG_WITHOUT_QUOTES }}"
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
run: |
echo "ALLURE_LAUNCH_ID=$(./allurectl launch create --launch-name '${{ env.ALLURE_LAUNCH_NAME }}' --no-header --format ID | tail -n1)" >> $GITHUB_ENV

- name: Upload tests to the Allure proj
if: always() && inputs.publish_to_allure == true
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
run: |
./allurectl upload allure-results --launch-id ${{ env.ALLURE_LAUNCH_ID }}
./allurectl launch close ${{ env.ALLURE_LAUNCH_ID }}
./allurectl upload allure-results
echo "*Public report link: https://raw.githack.com/matter-labs/block-explorer/gh-pages/${{ github.run_number }}/index.html"
echo "*Public report link will be available when the 'Allure Report' job will be succesfully executed."

- if: failure()
name: Save artifacts
Expand All @@ -146,18 +138,53 @@ jobs:
path: packages/app/tests/e2e/artifacts/*

publish:
name: Publish Allure link to GIT
name: Allure Report
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
needs: e2e
if: always()
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v2
with:
name: allure-results
path: packages/app/allure-results

- name: Get Allure history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Allure Report action from marketplace
uses: simple-elf/[email protected]
if: always()
id: allure-report
with:
allure_results: packages/app/allure-results
gh_pages: gh-pages
allure_report: allure-report
allure_history: allure-history
keep_reports: 10

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history

- name: Prepare a link
run: |
echo "BASE64_SEARCH_REQUEST=$(echo '${{ env.ALLURE_SEARCH_REQUEST }}' | base64)" >> $GITHUB_ENV

- name: Publish Allure link to GIT Summary
run: |
LINK="${{ vars.ALLURE_ENDPOINT }}project/${{ vars.ALLURE_PROJECT_ID }}/launches?search=${{ env.BASE64_SEARCH_REQUEST }}"
echo "Allure [e2e tests]($LINK) :rocket: in git run #${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY
LINK1="${{ vars.ALLURE_ENDPOINT }}project/${{ vars.ALLURE_PROJECT_ID }}/launches?search=${{ env.BASE64_SEARCH_REQUEST }}"
LINK2="https://raw.githack.com/matter-labs/block-explorer/gh-pages/${{ github.run_number }}/index.html"
echo "Allure [Private]($LINK1) and [Public]($LINK2) links:rocket: in git run #${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ jobs:
file: packages/worker/Dockerfile
no-cache: true

- name: Build and push Docker image for Data Fetcher
uses: docker/build-push-action@v4
with:
push: true
tags: |
"matterlabs/block-explorer-data-fetcher:latest"
"matterlabs/block-explorer-data-fetcher:v${{ needs.createReleaseVersion.outputs.releaseVersion }}"
"matterlabs/block-explorer-data-fetcher:${{ steps.setVersionForFlux.outputs.imageTag }}"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/block-explorer-data-fetcher:latest"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/block-explorer-data-fetcher:v${{ needs.createReleaseVersion.outputs.releaseVersion }}"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/block-explorer-data-fetcher:${{ steps.setVersionForFlux.outputs.imageTag }}"
file: packages/data-fetcher/Dockerfile
no-cache: true

- name: Build and push Docker image for App
uses: docker/build-push-action@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
packages/app/junit.xml
packages/api/junit.xml
packages/worker/junit.xml
packages/data-fetcher/junit.xml
check_run_annotations: all tests, skipped tests
report_individual_runs: "true"
check_name: Unit Test Results
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tests/e2e/reports/
# Logs
logs
!/packages/worker/test/logs/
!/packages/data-fetcher/test/logs/
*.log
npm-debug.log*
yarn-debug.log*
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<p align="center">Online blockchain browser for viewing and analyzing <a href="https://zksync.io">zkSync Era</a> blockchain.</p>

## 📌 Overview
This repository is a monorepo consisting of 3 packages:
- [Worker](./packages/worker) - an indexer service for [zkSync Era](https://zksync.io) blockchain data. The purpose of the service is to read the data from the blockchain in real time, transform it and fill in it's database with the data in a way that makes it easy to be queried by the [API](./packages/api) service.
This repository is a monorepo consisting of 4 packages:
- [Worker](./packages/worker) - an indexer service for [zkSync Era](https://zksync.io) blockchain data. The purpose of the service is to read blockchain data in real time, transform it and fill in it's database with the data in a way that makes it easy to be queried by the [API](./packages/api) service.
- [Data Fetcher](./packages/data-fetcher) - a service that exposes and implements an HTTP endpoint to retrieve aggregated data for a certain block / range of blocks from the blockchain. This endpoint is called by the [Worker](./packages/worker) service.
- [API](./packages/api) - a service providing Web API for retrieving structured [zkSync Era](https://zksync.io) blockchain data collected by [Worker](./packages/worker). It connects to the Worker's database to be able to query the collected data.
- [App](./packages/app) - a front-end app providing an easy-to-use interface for users to view and inspect transactions, blocks, contracts and more. It makes requests to the [API](./packages/api) to get the data and presents it in a way that's easy to read and understand.

Expand All @@ -22,10 +23,14 @@ flowchart
subgraph explorer[Block explorer]
Database[("Block explorer DB<br/>(PostgreSQL)")]
Worker(Worker service)
Data-Fetcher(Data Fetcher service)
API(API service)
App(App)


Worker-."Request aggregated data (HTTP)".->Data-Fetcher
Data-Fetcher-."Request data (HTTP)".->Blockchain
Worker-.Save processed data.->Database

API-.Query data.->Database
App-."Request data (HTTP)".->API
App-."Request data (HTTP)".->Blockchain
Expand All @@ -34,7 +39,7 @@ flowchart
Worker-."Request data (HTTP)".->Blockchain
```

[Worker](./packages/worker) service is responsible for getting data from blockchain using [zkSync Era JSON-RPC API](https://era.zksync.io/docs/api/api.html), processing it and saving into the database. [API](./packages/api) service is connected to the same database where it gets the data from to handle API requests. It performs only read requests to the database. The front-end [App](./packages/app) makes HTTP calls to the Block Explorer [API](./packages/api) to get blockchain data and to the [zkSync Era JSON-RPC API](https://era.zksync.io/docs/api/api.html) for reading contracts, performing transactions etc.
[Worker](./packages/worker) service retrieves aggregated data from the [Data Fetcher](./packages/data-fetcher) via HTTP and also directly from the blockchain using [zkSync Era JSON-RPC API](https://era.zksync.io/docs/api/api.html), processes it and saves into the database. [API](./packages/api) service is connected to the same database where it gets the data from to handle API requests. It performs only read requests to the database. The front-end [App](./packages/app) makes HTTP calls to the Block Explorer [API](./packages/api) to get blockchain data and to the [zkSync Era JSON-RPC API](https://era.zksync.io/docs/api/api.html) for reading contracts, performing transactions etc.

## 🚀 Features

Expand All @@ -58,12 +63,12 @@ npm install
## ⚙️ Setting up env variables

### Manually set up env variables
Make sure you have set up all the necessary env variables. Follow [Setting up env variables for Worker](./packages/worker#setting-up-env-variables) and [Setting up env variables for API](./packages/api#setting-up-env-variables) for instructions. For the [App](./packages/app) package you might want to edit environment config, see [Environment configs](./packages/app#environment-configs).
Make sure you have set up all the necessary env variables. Follow setting up env variables instructions for [Worker](./packages/worker#setting-up-env-variables), [Data Fetcher](./packages/data-fetcher#setting-up-env-variables) and [API](./packages/api#setting-up-env-variables). For the [App](./packages/app) package you might want to edit environment config, see [Environment configs](./packages/app#environment-configs).

### Build env variables based on your [zksync-era](https://github.com/matter-labs/zksync-era) local repo setup
Make sure you have [zksync-era](https://github.com/matter-labs/zksync-era) repo set up locally. You must have your environment variables files present in the [zksync-era](https://github.com/matter-labs/zksync-era) repo at `/etc/env/*.env` for the build envs script to work.

The following script sets `.env` files for [Worker](./packages/worker) and [API](./packages/api) packages as well as environment configuration file for [App](./packages/app) package based on your local [zksync-era](https://github.com/matter-labs/zksync-era) repo setup.
The following script sets `.env` files for [Worker](./packages/worker), [Data Fetcher](./packages/data-fetcher) and [API](./packages/api) packages as well as environment configuration file for [App](./packages/app) package based on your local [zksync-era](https://github.com/matter-labs/zksync-era) repo setup.
```bash
npm run hyperchain:configure
```
Expand All @@ -77,7 +82,7 @@ To create a database run the following command:
npm run db:create
```

To run all the packages (`Worker`, `API` and front-end `App`) in `development` mode run the following command from the root directory.
To run all the packages (`Worker`, `Data Fetcher`, `API` and front-end `App`) in `development` mode run the following command from the root directory.
```bash
npm run dev
```
Expand All @@ -102,7 +107,7 @@ To get block-explorer connected to your ZK Stack Hyperchain you need to set up a

## 🔍 Verify Block Explorer is up and running

To verify front-end `App` is running open http://localhost:3010 in your browser. `API` should be available at http://localhost:3020. `Worker` - http://localhost:3001.
To verify front-end `App` is running open http://localhost:3010 in your browser. `API` should be available at http://localhost:3020, `Worker` at http://localhost:3001 and `Data Fetcher` at http://localhost:3040.

## 🕵️‍♂️ Testing
Run unit tests for all packages:
Expand Down
36 changes: 24 additions & 12 deletions docker-compose-cli.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
version: '3.2'

services:
app:
build:
context: .
dockerfile: ./packages/app/Dockerfile
platform: linux/amd64
image: "matterlabs/block-explorer-app:${VERSION}"
ports:
- '3010:3010'
depends_on:
- api
restart: unless-stopped

worker:
build:
context: .
dockerfile: ./packages/worker/Dockerfile
platform: linux/amd64
image: "matterlabs/block-explorer-worker:${VERSION}"
environment:
- PORT=3001
- LOG_LEVEL=verbose
Expand All @@ -23,14 +19,30 @@ services:
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DATABASE_NAME=block-explorer
- BLOCKCHAIN_RPC_URL=http://host.docker.internal:3050
- BLOCKCHAIN_RPC_URL=http://host.docker.internal:${RPC_PORT}
- DATA_FETCHER_URL=http://data-fetcher:3040
- BATCHES_PROCESSING_POLLING_INTERVAL=1000
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"

data-fetcher:
platform: linux/amd64
image: "matterlabs/block-explorer-data-fetcher:${VERSION}"
environment:
- PORT=3040
- LOG_LEVEL=verbose
- NODE_ENV=development
- BLOCKCHAIN_RPC_URL=http://host.docker.internal:${RPC_PORT}
ports:
- '3040:3040'
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"

api:
build:
context: .
dockerfile: ./packages/api/Dockerfile
platform: linux/amd64
image: "matterlabs/block-explorer-api:${VERSION}"
environment:
- PORT=3020
- METRICS_PORT=3005
Expand Down
41 changes: 18 additions & 23 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ services:
build:
context: .
dockerfile: ./packages/app/Dockerfile
target: development-stage
command: npm run --prefix packages/app dev -- --host
ports:
- '3010:3010'
volumes:
- ./packages/app:/usr/src/app/packages/app
- /usr/src/app/packages/app/node_modules
depends_on:
- api
restart: unless-stopped
Expand All @@ -20,25 +15,33 @@ services:
build:
context: .
dockerfile: ./packages/worker/Dockerfile
target: development-stage
command: npm run --prefix packages/worker dev:debug
environment:
- PORT=3001
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_HOST=postgres
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DATABASE_NAME=block-explorer
- BLOCKCHAIN_RPC_URL=http://zksync:3050
- DATA_FETCHER_URL=http://data-fetcher:3040
- BATCHES_PROCESSING_POLLING_INTERVAL=1000
ports:
- '3001:3001'
- '9229:9229'
- '9230:9230'
volumes:
- ./packages/worker:/usr/src/app/packages/worker
- /usr/src/app/packages/worker/node_modules
depends_on:
zksync:
condition: service_healthy
restart: unless-stopped

data-fetcher:
build:
context: .
dockerfile: ./packages/data-fetcher/Dockerfile
environment:
- PORT=3040
- LOG_LEVEL=verbose
- BLOCKCHAIN_RPC_URL=http://zksync:3050
ports:
- '3040:3040'
depends_on:
zksync:
condition: service_healthy
Expand All @@ -48,22 +51,14 @@ services:
build:
context: .
dockerfile: ./packages/api/Dockerfile
target: development-stage
command: npm run --prefix packages/api dev:debug
environment:
- PORT=3020
- METRICS_PORT=3005
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/block-explorer
ports:
- '3020:3020'
- '3005:3005'
- '9231:9229'
- '9232:9230'
volumes:
- ./packages/api:/usr/src/app/packages/api
- /usr/src/app/packages/api/node_modules
depends_on:
- worker
restart: unless-stopped
Expand Down Expand Up @@ -120,11 +115,11 @@ services:
test: "curl -H \"Content-Type: application/json\" -X POST --data '{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":67}' 127.0.0.1:3050 || exit 1"
interval: 5s
timeout: 5s
retries: 120
retries: 300
restart: unless-stopped

volumes:
geth:
postgres:
zksync-config:
zksync-data:
zksync-data:
Loading
Loading