Skip to content

Commit

Permalink
fix: tests for unit of work changes (matter-labs#144)
Browse files Browse the repository at this point in the history
chore: fix dev discussions link (matter-labs#143)

- Updates dev discussions link
<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

- We updated the link
<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.

Co-authored-by: Vasyl Ivanchuk <[email protected]>

test: add allure public reports (matter-labs#68)

updated workflow to make public allure reports

current reports provide a link to a private url

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ + ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ n/a ] Tests for the changes have been added / updated.
- [ n/a ] Documentation comments have been added / updated.

---------

Co-authored-by: Vasyl Ivanchuk <[email protected]>

feat: initial changes to show erc20 as native token in explorer

feat: use nativechain instead of eth

feat: finishing touches to show ERC20 as native token

chore: rename .png

chore: rename png asset

feat: default to ethereum when rpc method is missing

fix: for error of missing method

fix: worker tests

fix: worker tests

fix: api tests and some e2e imports

fix: move token.ts file to work for imports

fix: common imports

feat: adapt to base-token-addr-endpoint

fix: worker tests

fix: docs links (matter-labs#150)

Fix links to documentation.

The documentation has been updated so we should use new links.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

feat: add data fetcher service (matter-labs#145)

Add data fetcher service that can be vertically scaled.

Having data fetching vertically scaled we will be able to keep up with
higher TPS.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

fix: remove portal from header (matter-labs#159)

- Remove Portal link from the top menu
- Do not show an error reason for the failed transaction if it's empty
- Docker compose starts services in production and not in development
mode
- Add zkVM filter option for solc compilers on the verification page

To fix bug reports / implement feature requests.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

---------

Co-authored-by: Oleh Bairak <[email protected]>

fix: add data fetcher debug logs (matter-labs#165)

Add more Data Fetcher debug logs.

For easier troubleshooting.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

fix: fix data-fetcher tests

chore: remove unused png

chore: replace "Native Token" with "Base Token"

chore: rename chainNative to baseToken

feat: move base token fetching to separate module

chore: remove old, unused code

fix: use base token instead of base token

fix: rename native token to base token

chore: remove old, unused code

fix: fix build, add comment

fix: restore postgres default password on config

feat: use base token from config in more places

chore: update .env.example

feat: move base-token fetching to a script

fix: data-fetcher unit tests

fix: api unit tests

fix: worker tests

fix: more tests

chore: properly import config

feat: rename to BaseToken

feat: remove baseTokenData function

feat: add base token address to configs

feat: use base token from config instead of constant

chore: remove unused scriped script

fix: add transaction error reason transformer (matter-labs#186)

Add transaction error reason transformer.

To unsure error and reason are transformed correctly.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).

fix: add graceful shutdown timeout (matter-labs#196)

Add graceful shutdown timeout.

To ensure that we can gracefully process all incoming HTTP requests
before shutting down the service.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

feat: add transfer type filter for address transfers BFF API (matter-labs#195)

Add filter by transfer type to the address transfers endpoint

It is useful to be able to get a list of transfers of certain type for
address. For example get list of withdrawals.

feat: add address transfer type migration (matter-labs#199)

- add script to migrate address transfer type

- standard migration would not be able to complete, script uses parallel
connections and updates data in small chunks.

fix: use new DataSource instance for migration script (matter-labs#200)

fix: use logger in migration scripts (matter-labs#201)

fix: update address transfers type index order (matter-labs#197)

fix: update goerli deprecation message (matter-labs#207)

New goerli deprecation message with a specific deprecation date:
<img width="1143" alt="image"
src="https://github.com/matter-labs/block-explorer/assets/6553665/3bb8b99e-4998-40c4-8100-e4144fa8aa81">

To notify users when the deprecation is gonna happen.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).

fix: improve fetcher usage (matter-labs#209)

1. Log timestamp in ISO8601 format.
2. Internal retries for `DataFetcherService`.

1. To have timestamps properly processed so logs are in the correct
order.
2. Otherwise in case of an error the whole batch is retried which is
unnecessary.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

fix: improve data fetcher response serialisation (matter-labs#216)

Get rid of the separate interceptor that transforms `BigNumber` to
string, accomplish the same result overriding `BigNumber` `toJSON`
function.

Separate interceptor is not optimal especially for blocks with lots of
related data, which we btw expect to see more often with higher TPS.
There are blocks where all related info weights 2Mb+ and it takes ~200ms
to transform the whole response object by the interceptor. Since after
the transformation JSON serialisation happens anyway, we can just
override `toJSON` for `BigNumber` and it will be picked up during JSON
serialisation. I checked that with this change generated response is the
same.

Performance improvement for large payloads (2Mb+):
1. Serialisation with interceptor (interceptor + json serialiser): avg
290ms
2. Serialisation with overridden `toJSON` (json serialiser): avg 34ms

But most important event loop is not blocked for a long time.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

feat: increase request body size limit (matter-labs#217)

feat: remove goerli network (matter-labs#219)

Remove goerli network.

Clean up the codebase since we stop supporting Goerli network.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.
- [X] Documentation comments have been added / updated.

fix: update baseToken to baseTokenData in E2E tests

fix(e2e tests): fix end-to-end test to use base token, modify eth address

fix(e2e tests): fix eth address in address e2e tests

fix(e2e tests): change missing apparences of l1 address

fix(e2e tests): non existing var name

fix: increase default timeout settings (matter-labs#228)

Increase default timeout settings.

To make sure explorer can handle large transactions.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

fix(e2e tests): valid address format

fix(e2e tests): add missing fields in select

fix(e2e tests): remove unused modules

fix(e2e tests): typecheck

fix(e2e tests): increase amount of selects in test

fix(e2e tests): add missing values in tests

test(coverage): api config with base token

test: uncomment tests

fix: remove non existing script

fix: address PR comments

fix: lint errors

fix: rpc method name

fix: rollback address capitalization

fix: use checksum address

fix: rename root hash to block hash (matter-labs#249)

Rename root hash on the block screen to block hash.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.

fix: use both version of the rpc response for getBridgeContract method

Revert "fix(e2e tests): add missing fields in select"

This reverts commit d3916ed.

Revert "fix(e2e tests): add missing fields in select"

This reverts commit d3916ed.

fix(e2e): account tests

fix: use correct amount of selects

test: add tests for old response

chore: fix docker compose (matter-labs#256)

Fix docker compose by applying the same updates that were done in
[local-setup](https://github.com/matter-labs/local-setup.)

Old docker compose doesn't work with the latest `local-node` docker
image.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).

fix: explorer doesn't require defined bridge address (matter-labs#257)

Fix explorer so that a defined bridge address is not required.

In-memory node doesn't have L1 network and bridge addresses defined.
This fix make explorer work with the in-memory node.

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.
  • Loading branch information
Romsters authored and SantiagoPittella committed May 28, 2024
1 parent 64c1026 commit 87c2f4c
Show file tree
Hide file tree
Showing 304 changed files with 17,066 additions and 2,888 deletions.
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
73 changes: 54 additions & 19 deletions .github/workflows/app-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
Expand Down Expand Up @@ -110,27 +116,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 @@ -140,18 +140,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 @@ -22,6 +22,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"
}
25 changes: 14 additions & 11 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 @@ -20,10 +21,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 @@ -32,7 +37,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 @@ -56,12 +61,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 @@ -75,7 +80,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 @@ -91,7 +96,7 @@ Each component can also be started individually. Follow individual packages `REA
## 🐳 Running in Docker
There is a docker compose configuration that allows you to run Block Explorer and all its dependencies in docker. Just run the following command to spin up the whole environment:
```
docker-compose up
docker compose up
```
It will run local Ethereum node, ZkSync Era, Postgres DB and all Block Explorer services.

Expand All @@ -100,7 +105,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 Expand Up @@ -129,9 +134,7 @@ zkSync Era Block Explorer is distributed under the terms of either
at your option.

## 🔗 Production links
- Testnet Goerli API: https://block-explorer-api.testnets.zksync.dev
- Testnet Sepolia API: https://block-explorer-api.sepolia.zksync.dev
- Mainnet API: https://block-explorer-api.mainnet.zksync.io
- Testnet Goerli App: https://goerli.explorer.zksync.io
- Testnet Sepolia App: https://sepolia.explorer.zksync.io
- Mainnet App: https://explorer.zksync.io
38 changes: 25 additions & 13 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 Expand Up @@ -60,4 +72,4 @@ services:
- POSTGRES_DB=block-explorer

volumes:
postgres:
postgres:
Loading

0 comments on commit 87c2f4c

Please sign in to comment.