From a7a67aab7cffa01272da1f2c2b6a0ee4d421d3a3 Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:16:21 +0100 Subject: [PATCH 1/2] refactor: improve zk stack block explorer guide pt1 --- docs/zk-stack/running-a-hyperchain/locally.md | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/docs/zk-stack/running-a-hyperchain/locally.md b/docs/zk-stack/running-a-hyperchain/locally.md index a4ecc23b09..ea02399822 100644 --- a/docs/zk-stack/running-a-hyperchain/locally.md +++ b/docs/zk-stack/running-a-hyperchain/locally.md @@ -114,19 +114,59 @@ You can now navigate to the displayed Portal URL (typically in your browser. `API` should be available at , `Worker` at and `Data Fetcher` at . +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 in your browser. `API` should be available at , `Worker` at and `Data Fetcher` at . ## Enabling Boojum prover From f4a2e43d65c4a36ba627376c62b555d84c3f0c49 Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Wed, 6 Mar 2024 07:12:46 +0000 Subject: [PATCH 2/2] refactor: improve zk stack block explorer guide pt1 --- docs/zk-stack/running-a-hyperchain/locally.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/zk-stack/running-a-hyperchain/locally.md b/docs/zk-stack/running-a-hyperchain/locally.md index af845c7e5a..4a250b08fc 100644 --- a/docs/zk-stack/running-a-hyperchain/locally.md +++ b/docs/zk-stack/running-a-hyperchain/locally.md @@ -122,19 +122,11 @@ Make sure you have your [zksync-era](https://github.com/matter-labs/zksync-era) 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). - -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: +Clone & install the block explorer repository: ```bash cd /path/to/where/you/clone/repos @@ -145,7 +137,7 @@ 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: +Next you need to set up all the necessary environment and configuration files with your hyperchain settings. You can use a script to set them up: ```bash npm run hyperchain:configure