Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
refactor: improve zk stack block explorer guide pt1
Browse files Browse the repository at this point in the history
  • Loading branch information
zk-Lumi authored Feb 22, 2024
1 parent f6271fa commit a7a67aa
Showing 1 changed file with 46 additions and 6 deletions.
52 changes: 46 additions & 6 deletions docs/zk-stack/running-a-hyperchain/locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,59 @@ You can now navigate to the displayed Portal URL (typically <http://localhost:30

### Using [Block Explorer](https://github.com/matter-labs/block-explorer)

A free open source block explorer is included with your hyperchain, and is accessible after running the local server. By default, you can access front-end `App` at <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>.
A free open source block explorer is available for your hyperchain. Block explorer contains three components [Worker](https://github.com/matter-labs/block-explorer/tree/main/packages/worker), [API](https://github.com/matter-labs/block-explorer/tree/main/packages/api), and [App](https://github.com/matter-labs/block-explorer/tree/main/packages/app), which you can run all together locally and connect to your hyperchain.

#### Editing environment & configuration files for block-explorer
Make sure you have your [zksync-era](https://github.com/matter-labs/zksync-era) repo set up locally and the `zk server` is running. The wizard in this guide allows you to run the server in the end. If you chose not to, you’re still able to run it by executing:

Block explorer contains three components [Worker](https://github.com/matter-labs/block-explorer/tree/main/packages/worker), [API](https://github.com/matter-labs/block-explorer/tree/main/packages/api), and [App](https://github.com/matter-labs/block-explorer/tree/main/packages/app), which you can run all together locally and connect to your hyperchain. For that, you need to set up all the necessary environment and configuration files with your hyperchain settings. You can use a script to build them. See [setting up env variables](https://github.com/matter-labs/block-explorer#%EF%B8%8F-setting-up-env-variables).
```bash
zk server --components "http_api,eth,state_keeper,housekeeper"
```

Running the `zk server` builds environment and configuration files for block explorer based on your [zksync-era](https://github.com/matter-labs/zksync-era) repo configuration, which you can edit if you need any changes.

### Running block explorer in docker

Docker makes it easy to run the block explorer quickly. To run the block explorer in docker, please follow the readme for [Block Explorer](https://github.com/matter-labs/block-explorer).

Once you have your [zksync-era](https://github.com/matter-labs/zksync-era) repo set up locally, you can run the following command to build environment and configuration files for block explorer based on your [zksync-era](https://github.com/matter-labs/zksync-era) repo configuration:
If you need to modify the block explorer, you can run it locally instead.

### Running block explorer locally

#### Install block explorer

Clone & install the block explorer:

```bash
zk server --components "http_api,eth,state_keeper,housekeeper"
cd /path/to/where/you/clone/repos
git clone https://github.com/matter-labs/block-explorer.git
cd block-explorer
npm install
```

#### Setting up env variables

Next you need to set up all the necessary environment and configuration files with your hyperchain settings. You can use a script to build them:

```bash
npm run hyperchain:configure
```

#### Run block explorer

Afterwards you can run the block explorer:

```bash
# if you are running block explorer for the first time
npm run db:create
```

```bash
npm run dev
```

The script generates all the necessary configuration files for block-explorer, which you can edit if you need any changes.
#### Verify block explorer is up and running

By default, you can access front-end `App` at <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>.

## Enabling Boojum prover

Expand Down

0 comments on commit a7a67aa

Please sign in to comment.