Skip to content

Commit

Permalink
fix: remove portal from header (#159)
Browse files Browse the repository at this point in the history
# What ❔

- 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

## Why ❔

To fix bug reports / implement feature requests.

## Checklist

<!-- 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]>
  • Loading branch information
vasyl-ivanchuk and olehbairak authored Feb 6, 2024
1 parent 7c8cab5 commit 0c6232a
Show file tree
Hide file tree
Showing 25 changed files with 229 additions and 145 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,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 Down
7 changes: 4 additions & 3 deletions docker-compose-cli.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
version: "3.2"
name: "zkcli-block-explorer"

services:
app:
platform: linux/amd64
Expand All @@ -26,6 +23,8 @@ services:
- 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
Expand All @@ -38,6 +37,8 @@ services:
ports:
- '3040:3040'
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"

api:
platform: linux/amd64
Expand Down
32 changes: 1 addition & 31 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: block-explorer
services:
app:
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 @@ -19,12 +13,9 @@ 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
Expand All @@ -34,11 +25,6 @@ services:
- 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
Expand All @@ -48,20 +34,12 @@ services:
build:
context: .
dockerfile: ./packages/data-fetcher/Dockerfile
target: development-stage
command: npm run --prefix packages/data-fetcher dev:debug
environment:
- PORT=3040
- LOG_LEVEL=verbose
- NODE_ENV=development
- BLOCKCHAIN_RPC_URL=http://zksync:3050
ports:
- '3040:3040'
- '9231:9229'
- '9232:9230'
volumes:
- ./packages/data-fetcher:/usr/src/app/packages/data-fetcher
- /usr/src/app/packages/data-fetcher/node_modules
depends_on:
zksync:
condition: service_healthy
Expand All @@ -71,22 +49,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'
- '9233:9229'
- '9234: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 @@ -143,7 +113,7 @@ 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:
Expand Down
2 changes: 0 additions & 2 deletions packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const config: EnvironmentConfig = {
icon: "/images/icons/zksync-arrows.svg",
l2ChainId: 270,
l2NetworkName: "Local",
l2WalletUrl: "https://goerli.staging-portal.zksync.dev/",
maintenance: false,
name: "local",
published: true,
Expand All @@ -60,7 +59,6 @@ const config: EnvironmentConfig = {
icon: "/images/icons/zksync-arrows.svg",
l2ChainId: 270,
l2NetworkName: "Local Hyperchain",
l2WalletUrl: "https://goerli.staging-portal.zksync.dev/",
maintenance: false,
name: "local-hyperchain",
published: true,
Expand Down
29 changes: 29 additions & 0 deletions packages/app/src/components/common/CheckBoxInput.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import CheckBoxInput from "./CheckBoxInput.vue";

export default {
title: "Common/CheckBoxInput",
component: CheckBoxInput,
};

type Args = {
modelValue: boolean;
};

const Template = (args: Args) => ({
components: { CheckBoxInput },
setup() {
return { args };
},
template: `
<CheckBoxInput v-bind="args">CheckBox Input</CheckBoxInput>`,
});

export const Checked = Template.bind({}) as unknown as { args: Args };
Checked.args = {
modelValue: true,
};

export const Unchecked = Template.bind({}) as unknown as { args: Args };
Unchecked.args = {
modelValue: false,
};
42 changes: 42 additions & 0 deletions packages/app/src/components/common/CheckBoxInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<label class="checkbox-input-container" :class="{ checked: inputted }">
<input type="checkbox" :checked="inputted" v-model="inputted" v-bind="$attrs" />
<slot />
</label>
</template>

<script lang="ts">
export default {
inheritAttrs: false,
};
</script>

<script setup lang="ts">
import { computed } from "vue";
const props = defineProps({
modelValue: {
type: Boolean,
default: null,
},
});
const emit = defineEmits<{
(eventName: "update:modelValue", value: unknown): void;
}>();
const inputted = computed({
get: () => props.modelValue,
set: (value: unknown) => {
emit("update:modelValue", value);
},
});
</script>

<style lang="scss" scoped>
.checkbox-input-container {
@apply flex items-center mb-1 cursor-pointer float-right leading-snug;
input {
@apply rounded me-1 text-primary-600 cursor-pointer border-neutral-200 checked:border-primary-600 hover:border-primary-600 ring-transparent;
}
}
</style>
2 changes: 1 addition & 1 deletion packages/app/src/components/form/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defineProps({
}
.label-inline-block {
.form-item-label {
@apply inline-block;
@apply float-left;
}
}
</style>
4 changes: 0 additions & 4 deletions packages/app/src/components/header/TheHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ const links = [
label: computed(() => t("header.nav.contractVerification")),
to: { name: "contract-verification" },
},
{
label: computed(() => t("header.nav.portal")),
url: computed(() => currentNetwork.value.l2WalletUrl),
},
];
if (currentNetwork.value.bridgeUrl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/>
</TableBodyColumn>
</tr>
<tr v-if="transaction?.status === 'failed'" class="transaction-table-row">
<tr v-if="transaction?.error || transaction?.revertReason" class="transaction-table-row">
<TableBodyColumn class="transaction-table-label">
<span class="transaction-info-field-label transaction-reason-label">
{{ t("transactions.table.reason") }}
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/composables/useRuntimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import type { NetworkConfig, RuntimeConfig } from "@/configs";
export const DEFAULT_NETWORK: NetworkConfig = {
apiUrl: "https://block-explorer-api.testnets.zksync.dev",
verificationApiUrl: "https://zksync2-testnet-explorer.zksync.dev",
bridgeUrl: "https://goerli.bridge.zksync.io",
bridgeUrl: "https://portal.zksync.io/bridge/?network=goerli",
hostnames: ["https://goerli.explorer.zksync.io"],
icon: "/images/icons/zksync-arrows.svg",
l1ExplorerUrl: "https://goerli.etherscan.io",
l2ChainId: 280,
l2NetworkName: "zkSync Era Goerli Testnet",
l2WalletUrl: "https://goerli.portal.zksync.io/",
maintenance: false,
name: "goerli",
published: true,
Expand Down
11 changes: 3 additions & 8 deletions packages/app/src/configs/dev.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"icon": "/images/icons/zksync-arrows.svg",
"l2ChainId": 270,
"l2NetworkName": "Local",
"l2WalletUrl": "http://localhost:3000",
"maintenance": false,
"name": "local",
"published": true,
Expand All @@ -18,15 +17,14 @@
{
"apiUrl": "https://block-explorer-api.testnets.zksync.dev",
"verificationApiUrl": "https://zksync2-testnet-explorer.zksync.dev",
"bridgeUrl": "https://staging.goerli.bridge.zksync.dev",
"bridgeUrl": "https://portal.zksync.io/bridge/?network=goerli",
"hostnames": [
"https://goerli.staging-scan-v2.zksync.dev"
],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://goerli.etherscan.io",
"l2ChainId": 280,
"l2NetworkName": "zkSync Era Goerli Testnet",
"l2WalletUrl": "https://goerli.staging-portal.zksync.dev/",
"maintenance": false,
"name": "goerli",
"published": true,
Expand All @@ -35,13 +33,12 @@
{
"apiUrl": "https://block-explorer-api.sepolia.zksync.dev",
"verificationApiUrl": "https://explorer.sepolia.era.zksync.dev",
"bridgeUrl": "https://staging.goerli.bridge.zksync.dev",
"bridgeUrl": "https://portal.zksync.io/bridge/?network=sepolia",
"hostnames": [],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://sepolia.etherscan.io",
"l2ChainId": 300,
"l2NetworkName": "zkSync Era Sepolia Testnet",
"l2WalletUrl": "https://staging-portal.zksync.dev/?network=era-boojnet",
"maintenance": false,
"name": "sepolia",
"published": true,
Expand All @@ -57,7 +54,6 @@
"l1ExplorerUrl": "https://goerli.etherscan.io",
"l2ChainId": 270,
"l2NetworkName": "Goerli (Stage2)",
"l2WalletUrl": "https://goerli-beta.staging-portal.zksync.dev/",
"maintenance": false,
"name": "goerli-beta",
"published": true,
Expand All @@ -66,15 +62,14 @@
{
"apiUrl": "https://block-explorer-api.mainnet.zksync.io",
"verificationApiUrl": "https://zksync2-mainnet-explorer.zksync.io",
"bridgeUrl": "https://staging.bridge.zksync.dev",
"bridgeUrl": "https://portal.zksync.io/bridge/?network=mainnet",
"hostnames": [
"https://staging-scan-v2.zksync.dev"
],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://etherscan.io",
"l2ChainId": 324,
"l2NetworkName": "zkSync Era Mainnet",
"l2WalletUrl": "https://staging-portal.zksync.dev/",
"maintenance": false,
"name": "mainnet",
"published": true,
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export type NetworkConfig = {
rpcUrl: string;
bridgeUrl?: string;
l2NetworkName: string;
l2WalletUrl: string;
l2ChainId: 270 | 280 | 324;
l1ExplorerUrl?: string;
maintenance: boolean;
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/configs/local.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"icon": "/images/icons/zksync-arrows.svg",
"l2ChainId": 270,
"l2NetworkName": "Local",
"l2WalletUrl": "http://localhost:3000",
"maintenance": false,
"name": "local",
"published": true,
Expand Down
9 changes: 3 additions & 6 deletions packages/app/src/configs/production.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
{
"apiUrl": "https://block-explorer-api.testnets.zksync.dev",
"verificationApiUrl": "https://zksync2-testnet-explorer.zksync.dev",
"bridgeUrl": "https://goerli.bridge.zksync.io",
"bridgeUrl": "https://portal.zksync.io/bridge/?network=goerli",
"hostnames": [
"https://goerli.explorer.zksync.io"
],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://goerli.etherscan.io",
"l2ChainId": 280,
"l2NetworkName": "zkSync Era Goerli Testnet",
"l2WalletUrl": "https://goerli.portal.zksync.io/",
"maintenance": false,
"name": "goerli",
"published": true,
Expand All @@ -20,15 +19,14 @@
{
"apiUrl": "https://block-explorer-api.sepolia.zksync.dev",
"verificationApiUrl": "https://explorer.sepolia.era.zksync.dev",
"bridgeUrl": "https://bridge.zksync.io",
"bridgeUrl": "https://portal.zksync.io/bridge/?network=sepolia",
"hostnames": [
"https://sepolia.explorer.zksync.io"
],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://sepolia.etherscan.io",
"l2ChainId": 300,
"l2NetworkName": "zkSync Era Sepolia Testnet",
"l2WalletUrl": "https://portal.zksync.io/",
"maintenance": false,
"name": "sepolia",
"published": true,
Expand All @@ -37,15 +35,14 @@
{
"apiUrl": "https://block-explorer-api.mainnet.zksync.io",
"verificationApiUrl": "https://zksync2-mainnet-explorer.zksync.io",
"bridgeUrl": "https://bridge.zksync.io",
"bridgeUrl": "https://portal.zksync.io/bridge/?network=mainnet",
"hostnames": [
"https://explorer.zksync.io"
],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://etherscan.io",
"l2ChainId": 324,
"l2NetworkName": "zkSync Era Mainnet",
"l2WalletUrl": "https://portal.zksync.io/",
"maintenance": false,
"name": "mainnet",
"published": true,
Expand Down
Loading

0 comments on commit 0c6232a

Please sign in to comment.