Skip to content

Commit

Permalink
Merge branch 'main' into integration-tests-final
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu authored Aug 27, 2024
2 parents f47c1d0 + d951ad0 commit e6ee734
Show file tree
Hide file tree
Showing 32 changed files with 95 additions and 95 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<h1 align="center">zkSync Era Block Explorer</h1>
<h1 align="center">ZKsync Era Block Explorer</h1>

<p align="center">Online blockchain browser for viewing and analyzing <a href="https://zksync.io">zkSync Era</a> blockchain.</p>
<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 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.
- [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.
- [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.

Also the repository contains [integration-test](./packages/integration-tests) package with a set of API and UI tests. Follow this [Readme](./packages/integration-tests/README.md) for more details.
Expand All @@ -17,7 +17,7 @@ The following diagram illustrates how are the block explorer components connecte
```mermaid
flowchart
subgraph blockchain[Blockchain]
Blockchain[zkSync Era JSON-RPC API]
Blockchain[ZKsync Era JSON-RPC API]
end
subgraph explorer[Block explorer]
Expand All @@ -39,7 +39,7 @@ flowchart
Worker-."Request data (HTTP)".->Blockchain
```

[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.
[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://docs.zksync.io/build/api-reference/ethereum-rpc), 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://docs.zksync.io/build/api-reference/ethereum-rpc) for reading contracts, performing transactions etc.

## 🚀 Features

Expand Down Expand Up @@ -128,7 +128,7 @@ For more details on testing please check individual packages `README`.
We follow the Conventional Commits [specification](https://www.conventionalcommits.org/en/v1.0.0/#specification).

## 📘 License
zkSync Era Block Explorer is distributed under the terms of either
ZKsync Era Block Explorer is distributed under the terms of either

- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We truly appreciate efforts to discover and disclose security issues responsibly
## Vulnerabilities

If you'd like to report a security issue in the repositories of matter-labs organization, please proceed to our
[Bug Bounty Program on Immunefi](https://era.zksync.io/docs/reference/troubleshooting/audit-bug-bounty.html#bug-bounty-program).
[Bug Bounty Program on Immunefi](https://immunefi.com/bug-bounty/zksyncera/information/).

## Other Security Issues

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "block-explorer",
"version": "1.0.0-development",
"title": "zkSync Era Block Explorer",
"description": "zkSync Era Block Explorer",
"title": "ZKsync Era Block Explorer",
"description": "ZKsync Era Block Explorer",
"author": "Matter Labs",
"license": "MIT",
"repository": "https://github.com/matter-labs/block-explorer",
Expand Down
8 changes: 4 additions & 4 deletions packages/api/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# zkSync Era Block Explorer API
# ZKsync Era Block Explorer API
## Overview

`zkSync Era Block Explorer API` is a block explorer API for zkSync Era blockchain.
The service provides API for retrieving structured zkSync Era blockchain data. It must be connected to the [Block explorer Worker](/packages/worker) database.
`ZKsync Era Block Explorer API` is a block explorer API for ZKsync Era blockchain.
The service provides API for retrieving structured ZKsync Era blockchain data. It must be connected to the [Block explorer Worker](/packages/worker) database.

There are 2 sets of endpoints the service provides. All the endpoints under `/api/*` are designed for external direct usage. These endpoints are similar to [Etherscan API](https://docs.etherscan.io) endpoints. The development of these endpoints is in progress, so more of them will be added soon. The other set of endpoints (other than `/api/*`) is designed to be used by the front-end [App](/packages/app) only and is not meant to be used externally. Once all the new `/api/*` endpoints are developed all the other endpoints (other than `/api/*`) will be deprecated and removed.

Expand All @@ -24,7 +24,7 @@ You need to have a running Worker database, for instructions on how to run the w
- `DATABASE_REPLICA_URL_<<replica_index>>`
- `DATABASE_CONNECTION_IDLE_TIMEOUT_MS`
- `DATABASE_CONNECTION_POOL_SIZE`
- Set `CONTRACT_VERIFICATION_API_URL` to your verification API URL. For zkSync Era testnet use `https://zksync2-testnet-explorer.zksync.dev`. For zkSync Era mainnet - `https://zksync2-mainnet-explorer.zksync.io`.
- Set `CONTRACT_VERIFICATION_API_URL` to your verification API URL. For ZKsync Era testnet use `https://zksync2-testnet-explorer.zksync.dev`. For ZKsync Era mainnet - `https://zksync2-mainnet-explorer.zksync.io`.

## Custom base token configuration
For networks with a custom base token, there are a number of environment variables used to configure custom base and ETH tokens:
Expand Down
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "api",
"version": "0.0.0",
"title": "zkSync Era Block Explorer API",
"description": "zkSync Era Block Explorer API",
"title": "ZKsync Era Block Explorer API",
"description": "ZKsync Era Block Explorer API",
"author": "Matter Labs",
"private": true,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/api/block/block.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class BlockController {
blockMiner: block.miner,
// There is no such term as block reward for now.
blockReward: "0",
// There are no uncles in zkSync.
// There are no uncles in ZKsync.
uncles: [],
uncleInclusionReward: "0",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/app/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# zkSync Era Block Explorer App
# ZKsync Era Block Explorer App
## Overview
`zkSync Era Block Explorer App` is a front-end app providing an easy-to-use interface for users to view and inspect transactions, blocks, contracts and more on [zkSync Era](https://zksync.io) blockchain.
`ZKsync Era Block Explorer App` is a front-end app providing an easy-to-use interface for users to view and inspect transactions, blocks, contracts and more on [ZKsync Era](https://zksync.io) blockchain.

## Recommended IDE Setup

Expand Down
10 changes: 5 additions & 5 deletions packages/app/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>zkSync Era Block Explorer</title>
<title>ZKsync Era Block Explorer</title>
<meta charset="UTF-8" />
<meta name="description" content="zkSync Era Block Explorer provides all the information to deep dive into transactions, blocks, contracts, and much more. Deep dive into zkSync Era and explore the network."/>
<meta name="description" content="ZKsync Era Block Explorer provides all the information to deep dive into transactions, blocks, contracts, and much more. Deep dive into ZKsync Era and explore the network."/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta property="og:title" content="zkSync Era Block Explorer" />
<meta property="og:description" content="zkSync Era Block Explorer provides all the information to deep dive into transactions, blocks, contracts, and much more. Deep dive into zkSync Era and explore the network." />
<meta property="og:title" content="ZKsync Era Block Explorer" />
<meta property="og:description" content="ZKsync Era Block Explorer provides all the information to deep dive into transactions, blocks, contracts, and much more. Deep dive into ZKsync Era and explore the network." />
<meta property="og:image" content="https://explorer.zksync.io/preview.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="zkSync Era Block Explorer" />
<meta property="og:image:alt" content="ZKsync Era Block Explorer" />

<link rel="alternate icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
Expand Down
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "app",
"version": "0.0.0",
"title": "zkSync Era Block Explorer App",
"description": "zkSync Era Block Explorer App",
"title": "ZKsync Era Block Explorer App",
"description": "ZKsync Era Block Explorer App",
"author": "Matter Labs",
"private": true,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/NetworkSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Listbox as="div" :model-value="selected" class="network-switch">
<ListboxButton class="toggle-button">
<span class="network-item">
<img :src="currentNetwork.icon" alt="zkSync arrows logo" class="network-item-img" />
<img :src="currentNetwork.icon" alt="ZKsync arrows logo" class="network-item-img" />
<span class="network-item-label">{{ currentNetwork.l2NetworkName }}</span>
</span>
<span class="toggle-button-icon-wrapper">
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/header/TheHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="header-container">
<div class="logo-container">
<router-link :to="{ name: 'home' }">
<span class="sr-only">zkSync</span>
<span class="sr-only">ZKsync</span>
<zk-sync-era />
</router-link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/composables/useRuntimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const DEFAULT_NETWORK: NetworkConfig = {
icon: "/images/icons/zksync-arrows.svg",
l1ExplorerUrl: "https://sepolia.etherscan.io",
l2ChainId: 300,
l2NetworkName: "zkSync Era Sepolia Testnet",
l2NetworkName: "ZKsync Era Sepolia Testnet",
maintenance: false,
name: "sepolia",
published: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/configs/dev.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://sepolia.etherscan.io",
"l2ChainId": 300,
"l2NetworkName": "zkSync Era Sepolia Testnet",
"l2NetworkName": "ZKsync Era Sepolia Testnet",
"maintenance": false,
"name": "sepolia",
"published": true,
Expand Down Expand Up @@ -56,7 +56,7 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://etherscan.io",
"l2ChainId": 324,
"l2NetworkName": "zkSync Era Mainnet",
"l2NetworkName": "ZKsync Era Mainnet",
"maintenance": false,
"name": "mainnet",
"published": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/configs/production.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://sepolia.etherscan.io",
"l2ChainId": 300,
"l2NetworkName": "zkSync Era Sepolia Testnet",
"l2NetworkName": "ZKsync Era Sepolia Testnet",
"maintenance": false,
"name": "sepolia",
"published": true,
Expand All @@ -27,7 +27,7 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://etherscan.io",
"l2ChainId": 324,
"l2NetworkName": "zkSync Era Mainnet",
"l2NetworkName": "ZKsync Era Mainnet",
"maintenance": false,
"name": "mainnet",
"published": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/configs/staging.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://sepolia.etherscan.io",
"l2ChainId": 300,
"l2NetworkName": "zkSync Era Sepolia Testnet",
"l2NetworkName": "ZKsync Era Sepolia Testnet",
"maintenance": false,
"name": "sepolia",
"published": true,
Expand Down Expand Up @@ -43,7 +43,7 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://etherscan.io",
"l2ChainId": 324,
"l2NetworkName": "zkSync Era Mainnet",
"l2NetworkName": "ZKsync Era Mainnet",
"maintenance": false,
"name": "mainnet",
"published": true,
Expand Down
18 changes: 9 additions & 9 deletions packages/app/src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"general": {
"l2NetworkName": "zkSync Era",
"l2NetworkName": "ZKsync Era",
"l1NetworkName": "Ethereum"
},
"copyButton": {
Expand All @@ -15,7 +15,7 @@
"networkStats": {
"title": "Network Stats",
"subtitleTestnet": "Stats are occasionally reset on testnet.",
"subtitleMainnet": "zkSync Era Mainnet is open to everyone.",
"subtitleMainnet": "ZKsync Era Mainnet is open to everyone.",
"committed": "Committed Blocks",
"verified": "Verified Blocks",
"transactions": "Transactions",
Expand Down Expand Up @@ -309,8 +309,8 @@
"subtitle": "zkRollups significantly cheaper than L1 or Optimistic Rollups"
},
"blockExplorer": {
"title": "zkSync Era Block Explorer",
"subtitle": "zkSync Era Block Explorer provides all the information to deep dive into transactions, blocks, contracts, and much more. Deep dive into zkSync Era and explore the network.",
"title": "ZKsync Era Block Explorer",
"subtitle": "ZKsync Era Block Explorer provides all the information to deep dive into transactions, blocks, contracts, and much more. Deep dive into ZKsync Era and explore the network.",
"latestBlocks": "Latest Blocks",
"latestTransactions": "Latest Transactions",
"batches": "Latest Batches"
Expand Down Expand Up @@ -664,7 +664,7 @@
}
},
"document": {
"title": "zkSync Era Block Explorer",
"title": "ZKsync Era Block Explorer",
"home": "Transactions, Blocks, Contracts and much more"
},
"notFound": {
Expand All @@ -674,11 +674,11 @@
"contactSupport": "contact support"
},
"maintenance": {
"title": "zkSync {network} is on maintainance",
"description": "zkSync {network} is unavailable due to maintainance, you can find updates in our {twitter} or on {uptime}",
"twitterLink": "zkSync Developers",
"title": "ZKsync {network} is on maintainance",
"description": "ZKsync {network} is unavailable due to maintainance, you can find updates in our {twitter} or on {uptime}",
"twitterLink": "ZKsync Developers",
"uptimeLink": "UpTime",
"twitterButton": "zkSync Developers"
"twitterButton": "ZKsync Developers"
},
"tabs": {
"transactions": "Transactions",
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/locales/uk.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"general": {
"l2NetworkName": "zkSync Era",
"l2NetworkName": "ZKsync Era",
"l1NetworkName": "Ethereum"
},
"copyButton": {
Expand Down Expand Up @@ -175,7 +175,7 @@
"subtitle": "zkRollups значно дешевше, ніж L1 або Optimistic Rollups"
},
"blockExplorer": {
"title": "zkSync Era Провідник",
"title": "ZKsync Era Провідник",
"subtitle": "Переглядайте в режимі реального часу інформацію про блоки, транзакції, контракти та іншу активність у мережі.",
"latestBlocks": "Останні Блоки",
"latestTransactions": "Останні транзакції"
Expand Down Expand Up @@ -410,7 +410,7 @@
}
},
"document": {
"title": "zkSync Era Провідник",
"title": "ZKsync Era Провідник",
"home": "Транзакції, Блоки, Контракти та інше"
},
"notFound": {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/views/MaintenanceView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
{{ currentNetwork.l2NetworkName }}
</template>
<template #twitter>
<a href="https://twitter.com/zkSyncDevs" target="_blank">{{ t("maintenance.twitterLink") }}</a>
<a href="https://twitter.com/ZKsyncDevs" target="_blank">{{ t("maintenance.twitterLink") }}</a>
</template>
<template #uptime>
<a href="https://uptime.com/statuspage/era" target="_blank">{{ t("maintenance.uptimeLink") }}</a>
</template>
</i18n-t>
<Button class="twitter-button" tag="a" href="https://twitter.com/zkSyncDevs" target="_blank">
<Button class="twitter-button" tag="a" href="https://twitter.com/ZKsyncDevs" target="_blank">
{{ t("maintenance.twitterButton") }}
</Button>
<a class="uptime-link" href="https://uptime.com/statuspage/era" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion packages/app/tests/components/NetworkStats.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe("NetworkStats:", () => {
global,
});

expect(wrapper.find(".subtitle").text()).toBe("zkSync Era Mainnet is open to everyone.");
expect(wrapper.find(".subtitle").text()).toBe("ZKsync Era Mainnet is open to everyone.");
mockNetwork.mockRestore();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Feature: Main Page

Examples:
| Value | Dropdown |
| zkSync Era Mainnet | network |
| ZKsync Era Mainnet | network |
| EN | language |
| UA | language |

Expand All @@ -59,7 +59,7 @@ Feature: Main Page

Examples:
| Value | Dropdown |
| zkSync Era Sepolia Testnet | network |
| ZKsync Era Sepolia Testnet | network |
| Goerli (Stage2) | network |

@id254:II @productionEnv
Expand All @@ -69,7 +69,7 @@ Feature: Main Page

Examples:
| Value | Dropdown |
| zkSync Era Sepolia Testnet | network |
| ZKsync Era Sepolia Testnet | network |

Scenario: Network stats is displayed
Then Element with "text" "Network Stats" should be "visible"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Feature: Main Page
Examples:
| Block |
| Network Stats |
| zkSync Era Mainnet is open to everyone. |
| ZKsync Era Mainnet is open to everyone. |
| Committed Blocks |
| Verified Blocks |
| Transactions |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: Redirection
Given I am on main page

@id238
Scenario: Check zkSync logo redirection from Account page to Main page
Scenario: Check ZKsync logo redirection from Account page to Main page
Given I go to page "/address/0x0000000000000000000000000000000000000000"
When I click on main logo
Given I am on main page
Expand Down
Loading

0 comments on commit e6ee734

Please sign in to comment.