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

fix(zk_toolbox): readme added dependencies section and cleaned up #2044

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions checks-config/era.dic
Original file line number Diff line number Diff line change
Expand Up @@ -968,3 +968,4 @@ DCMAKE
preloaded
e2e
upcasting
foundryup
9 changes: 9 additions & 0 deletions docs/guides/setup-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ 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
foundryup --branch master
```

## Supported operating systems
Expand Down Expand Up @@ -257,6 +261,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`):
Expand Down
42 changes: 33 additions & 9 deletions zk_toolbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ 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).

### 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
```
Expand All @@ -33,20 +41,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 <name>` 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.
Expand All @@ -56,22 +70,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 <chain_name>` argument
2 changes: 1 addition & 1 deletion zk_toolbox/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
stable
stable-1.78.0
Loading