From 75678bdf399efd3d6891d0b271246977acd1d86f Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Fri, 24 May 2024 13:00:57 +0200 Subject: [PATCH 1/5] fix(zk_toolbox): readme added dependencies section and cleaned up --- zk_toolbox/README.md | 48 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/zk_toolbox/README.md b/zk_toolbox/README.md index f039ef210d48..440044352304 100644 --- a/zk_toolbox/README.md +++ b/zk_toolbox/README.md @@ -7,15 +7,29 @@ Toolkit for creating and managing ZK Stack chains. ZK Inception facilitates the creation and management of ZK Stacks. All commands are interactive, but you can also pass all necessary arguments via the command line. +### Dependencies + +Ensure you have followed +[these instructions](https://github.com/matter-labs/zksync-era/blob/main/docs/guides/setup-dev.md) to set up +dependencies on your machine (don't worry about the Environment section for now). + +In addition to the above instructions, you will also need to +[install Foundry](https://book.getfoundry.sh/getting-started/installation). + +IMPORTANT: Ensure you are running the latest stable releases of Rust using `rustup update stable` (rustc 1.78.0) & cargo +using `cargo update` (cargo 1.78.0). + ### Installation Install zk_inception from git: -`cargo install --git https://github.com/matter-labs/zksync-era/ --locked zk_inception --force` +```bash +cargo install --git https://github.com/matter-labs/zksync-era/ --locked zk_inception --force +``` Manually building from a local copy of the [ZkSync](https://github.com/matter-labs/zksync-era/) repository: -``` +```bash cd zk_toolbox cargo install --path ./crates/zk_inception --force --locked ``` @@ -33,20 +47,26 @@ that connects all ZK chains, like the BridgeHub, the shared bridges, and state t To create a ZK Stack project, you must first create an ecosystem: -`zk_inception ecosystem create` +```bash +zk_inception ecosystem create +``` All subsequent commands should be executed from within the ecosystem folder. If the ecosystem has never been deployed before, initialization is required: -`zk_inception ecosystem init` +```bash +zk_inception ecosystem init +``` This command also initializes the first ZK chain. Note that the very first chain becomes the default one, but you can override it with another by using the `--chain ` flag. To change the default ZK chain, use: -`zk_inception ecosystem change-default-chain` +```bash +zk_inception ecosystem change-default-chain +``` IMPORTANT: It is not yet possible to use an existing ecosystem and register a chain to it. this feature will be added in the future. @@ -56,22 +76,32 @@ the future. Upon ecosystem creation, the first ZK chain is automatically generated. However, you can create additional chains and switch between them: -`zk_inception chain create` +```bash +zk_inception chain create +``` Once created, contracts for the ZK chain must be deployed: -`zk_inception chain init` +```bash +zk_inception chain init +``` Initialization utilizes the ecosystem's governance to register it in the BridgeHub. If contracts were deployed by a third party (e.g., MatterLabs), you may need to run the genesis process locally: -`zk_inception chain genesis` +```bash +zk_inception chain genesis +``` This ensures proper initialization of the server. ### Zk Server -For running the chain: `zk_inception server` +For running the chain: + +```bash +zk_inception server +``` You can specify the chain you are running by providing `--chain ` argument From 5a4a877f4ea990582197230573045569a216b6f9 Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Fri, 24 May 2024 13:26:44 +0200 Subject: [PATCH 2/5] fix(zk_toolbox): update rust toolchain and remove foundry req --- zk_toolbox/README.md | 6 ------ zk_toolbox/rust-toolchain | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/zk_toolbox/README.md b/zk_toolbox/README.md index 440044352304..eef826da1564 100644 --- a/zk_toolbox/README.md +++ b/zk_toolbox/README.md @@ -13,12 +13,6 @@ Ensure you have followed [these instructions](https://github.com/matter-labs/zksync-era/blob/main/docs/guides/setup-dev.md) to set up dependencies on your machine (don't worry about the Environment section for now). -In addition to the above instructions, you will also need to -[install Foundry](https://book.getfoundry.sh/getting-started/installation). - -IMPORTANT: Ensure you are running the latest stable releases of Rust using `rustup update stable` (rustc 1.78.0) & cargo -using `cargo update` (cargo 1.78.0). - ### Installation Install zk_inception from git: diff --git a/zk_toolbox/rust-toolchain b/zk_toolbox/rust-toolchain index 2bf5ad0447d3..fb426719abc7 100644 --- a/zk_toolbox/rust-toolchain +++ b/zk_toolbox/rust-toolchain @@ -1 +1 @@ -stable +stable-1.78.0 From 3f0c6c8041d126993eba0e66a4089204df1396d6 Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Fri, 24 May 2024 13:35:34 +0200 Subject: [PATCH 3/5] fix(docs): add foundry installation to setup-dev --- docs/guides/setup-dev.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/guides/setup-dev.md b/docs/guides/setup-dev.md index a27cdd3ea593..49eccc24e422 100644 --- a/docs/guides/setup-dev.md +++ b/docs/guides/setup-dev.md @@ -27,6 +27,11 @@ cargo install sqlx-cli --version 0.7.3 sudo systemctl stop postgresql # Start docker. sudo systemctl start docker + +# Foundry +curl -L https://foundry.paradigm.xyz | bash +rustup update stable +foundryup --branch master ``` ## Supported operating systems @@ -257,6 +262,11 @@ enable nix-ld. Go to the zksync folder and run `nix develop --impure`. After it finishes, you are in a shell that has all the dependencies. +## Foundry + +[Foundry](https://book.getfoundry.sh/getting-started/installation) can be utilized for deploying smart contracts. For +commands related to deployment, you can pass flags for Foundry integration. + ## Environment Edit the lines below and add them to your shell profile file (e.g. `~/.bash_profile`, `~/.zshrc`): From 6ead62e7c147c4e38173b1d4be1fd72570b76eb9 Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Fri, 24 May 2024 13:52:18 +0200 Subject: [PATCH 4/5] fix(docs): added foundryup to dictionary --- checks-config/era.dic | 1 + 1 file changed, 1 insertion(+) diff --git a/checks-config/era.dic b/checks-config/era.dic index 71a14eda86ca..063c129b3e66 100644 --- a/checks-config/era.dic +++ b/checks-config/era.dic @@ -968,3 +968,4 @@ DCMAKE preloaded e2e upcasting +foundryup From 6a5e98ee6d5083d5fed14e423a73133ebb73fd3e Mon Sep 17 00:00:00 2001 From: Daniel Lumi <149794418+zk-Lumi@users.noreply.github.com> Date: Fri, 24 May 2024 13:53:24 +0200 Subject: [PATCH 5/5] fix(docs): removed unnecessary rustup update instruction --- docs/guides/setup-dev.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/guides/setup-dev.md b/docs/guides/setup-dev.md index 49eccc24e422..f096a2f8a270 100644 --- a/docs/guides/setup-dev.md +++ b/docs/guides/setup-dev.md @@ -30,7 +30,6 @@ sudo systemctl start docker # Foundry curl -L https://foundry.paradigm.xyz | bash -rustup update stable foundryup --branch master ```