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

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

Open
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

fkrause98
Copy link

@fkrause98 fkrause98 commented Jan 22, 2024

What ❔

Update the explorer to show the ERC20 as the explorer's native token.

Closes #1.

Why ❔

To reflect the current state of the chain.

Setup and first check

Start the zk server

Go to our fork repo of zksync-era and checkout to kl-factory, run:

  zk init --base-token-name BAT

After it finishes, start the server:

zk server

Explorer setup

  1. Install dependencies:
  npm i 
  1. Build the project:
   npm run build
  1. Set these env vars:
export DATABASE_HOST="127.0.0.1"
export BLOCKCHAIN_RPC_URL="http://127.0.0.1:3050"
export DATABASE_URL="postgres://postgres:[email protected]:5432/block-explorer"
  1. Create the db:
   npm run db:create
  1. Start the server:
   npm run dev

Go to http://localhost:3010/ , the block explorer should be up and running,
but it probably won't be showing any transactions for now.

You should see something like this:
image

Setup and second check.

Do the steps above again, but run zk init without any other argument, the block
explorer should show ETH as the native token when doing a transaction.

Checklist

  • 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.

@fkrause98 fkrause98 marked this pull request as ready for review January 26, 2024 19:49
juan518munoz
juan518munoz previously approved these changes Jan 29, 2024
Copy link

@juan518munoz juan518munoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
image

Santiago Pittella and others added 30 commits April 10, 2024 12:23
# What ❔

Increase default timeout settings.

## Why ❔

To make sure explorer can handle large transactions.

## 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.
# What ❔

Rename root hash on the block screen to block hash.

## 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.
…block-explorer into show-native-erc20token-info
…block-explorer into show-native-erc20token-info
# What ❔

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

## Why ❔

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

## 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).
# What ❔

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

## Why ❔

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

## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display information about the native token of the chain being shown
4 participants