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

docs(zkstack_cli): update docs to mention foundry zksync #3134

Merged
merged 71 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
714501a
docs: recommend foundry-zksync installation
manuelmauro Oct 21, 2024
bb58441
docs: remove mention to ZKSYNC_HOME
manuelmauro Oct 21, 2024
b57a31c
docs: update mention to foundry-zksync
manuelmauro Oct 21, 2024
4c6026f
docs: update development guide
manuelmauro Oct 21, 2024
002e4bd
docs: add convenience note
manuelmauro Oct 21, 2024
0070e88
style: format code
manuelmauro Oct 21, 2024
5e116a8
docs: add re-installation note
manuelmauro Oct 21, 2024
528a344
style: format code
manuelmauro Oct 21, 2024
7296abb
docs: improve readability
manuelmauro Oct 21, 2024
d488e1e
docs: update launch.md to use zkstack commands
manuelmauro Oct 21, 2024
62f4344
style: format code
manuelmauro Oct 21, 2024
c9f891b
docs: remove dead refs
manuelmauro Oct 22, 2024
1ba533b
docs: remove mention to zk
manuelmauro Oct 22, 2024
18d6bd8
docs: fix initialization chapter
manuelmauro Oct 22, 2024
b37a18c
docs: improve style
manuelmauro Oct 22, 2024
b33633e
Merge branch 'main' into manuel-update-docs-to-mention-foundry-zksync
manuelmauro Oct 23, 2024
4d2eae2
style: format code
manuelmauro Oct 23, 2024
83be284
Merge branch 'main' into manuel-update-docs-to-mention-foundry-zksync
manuelmauro Oct 24, 2024
da2734c
docs: keep postgres section
manuelmauro Oct 24, 2024
f98931a
docs: do not mention ZKSYNC_HOME
manuelmauro Oct 24, 2024
3dfc55e
docs: no need to build contracts manually
manuelmauro Oct 24, 2024
9b44cde
docs: mention location of server's configuration files
manuelmauro Oct 24, 2024
9f14431
docs: add two troubleshoot items
manuelmauro Oct 24, 2024
fa323b2
style: format
manuelmauro Oct 24, 2024
3b9ba47
docs: running prover without a GPU is currently unsupported
manuelmauro Oct 24, 2024
30f3991
docs: document how to run prover on GCP
manuelmauro Oct 24, 2024
26626de
docs: add section on contract verification with foundry
manuelmauro Oct 24, 2024
d1f62a4
docs: add more information on verification options
manuelmauro Oct 24, 2024
fb56e18
docs: update launch docs to use zkstack
manuelmauro Oct 24, 2024
76300be
Update docs/guides/launch.md
manuelmauro Oct 28, 2024
3216bb1
docs: remove outdated section
manuelmauro Oct 28, 2024
7d65381
Update docs/guides/launch.md
manuelmauro Oct 29, 2024
0c2bfc3
Update prover/docs/03_launch.md
manuelmauro Oct 29, 2024
1187124
docs: add note on WVG memory footprint
manuelmauro Oct 29, 2024
1d9d724
docs: add section on prover job monitor
manuelmauro Oct 29, 2024
830a3ad
docs: add section on inserting/querying protocol version in prover DB
manuelmauro Oct 29, 2024
82951c1
style: format code
manuelmauro Oct 29, 2024
f8ec22b
Update docs/guides/development.md
manuelmauro Oct 30, 2024
032da8f
docs: instruct users to install the porject's dependency Foundry ZKsync
manuelmauro Oct 31, 2024
daae0a3
docs: suggest the use of --dev flag for local development
manuelmauro Oct 31, 2024
154e6e0
docs: invite users to supply the --verbose option for long-running co…
manuelmauro Oct 31, 2024
0f309bd
style: format code
manuelmauro Oct 31, 2024
010e7a9
docs: remove Re-initialization section
manuelmauro Oct 31, 2024
027c7d5
style: format code
manuelmauro Oct 31, 2024
a1903e9
Update docs/guides/launch.md
manuelmauro Oct 31, 2024
acc12ee
docs: change recommendation on rust's toolchain version
manuelmauro Oct 31, 2024
cd62bfc
docs: improve "Installing the local ZK Stack CLI" section
manuelmauro Oct 31, 2024
11fee43
docs: refer to setup-dev.md in development.md
manuelmauro Oct 31, 2024
af79a06
docs: improve spelling
manuelmauro Oct 31, 2024
38c9ea8
Merge branch 'main' into manuel-update-docs-to-mention-foundry-zksync
manuelmauro Nov 5, 2024
5b6cd89
docs: recommend client-only PostgreSQL installation
manuelmauro Nov 5, 2024
e9381f9
style: format
manuelmauro Nov 5, 2024
27e8a30
docs: update TL;DR
manuelmauro Nov 5, 2024
09063cc
docs: improve formatting/style
manuelmauro Nov 5, 2024
1956a2e
docs: add section on manually editing config files
manuelmauro Nov 6, 2024
d0f6415
Update docs/guides/advanced/01_initialization.md
manuelmauro Nov 6, 2024
8dc0d03
Update docs/guides/advanced/01_initialization.md
manuelmauro Nov 6, 2024
01f7960
Update docs/guides/advanced/01_initialization.md
manuelmauro Nov 6, 2024
fe4dc52
Update docs/guides/development.md
manuelmauro Nov 6, 2024
1585f8c
Update docs/guides/development.md
manuelmauro Nov 6, 2024
f47ecc3
Update docs/guides/launch.md
manuelmauro Nov 6, 2024
f1041fe
style: format code
manuelmauro Nov 6, 2024
a931c1b
docs: do not suggest a command to install Foundry Zksync
manuelmauro Nov 12, 2024
c888bb4
style: format docs
manuelmauro Nov 12, 2024
6101949
Update docs/guides/advanced/01_initialization.md
manuelmauro Nov 12, 2024
d808f3d
docs: fix tips H level
manuelmauro Nov 12, 2024
fc8d958
docs: expand section on ecosystem configuration
manuelmauro Nov 12, 2024
1ce117b
style: format docs
manuelmauro Nov 12, 2024
4bde05c
docs: give more guidance on running tests
manuelmauro Nov 12, 2024
d170f4c
docs: add load test section
manuelmauro Nov 12, 2024
adbdf50
docs: remove zk_inception and zk_supervisor wording
manuelmauro Nov 12, 2024
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
46 changes: 29 additions & 17 deletions docs/guides/advanced/01_initialization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ZKsync deeper dive
# ZKsync Deeper Dive

The goal of this doc is to show you some more details on how ZKsync works internally.

Expand All @@ -7,30 +7,42 @@ system).

Now let's take a look at what's inside:

### Initialization (zk init)
### Initialization

Let's take a deeper look into what `zk init` does.
Let's take a deeper look into what `zkstack ecosystem init` does.

#### zk tool
#### ZK Stack CLI

`zk` itself is implemented in typescript (you can see the code in `infrastructure` directory). If you change anything
there, make sure to run `zk` (that compiles this code), before re-running `zk init`.
`zkstack` itself is implemented in Rust (you can see the code in `/zkstack_cli` directory). If you change anything
there, make sure to run `zkstackup --local` from the root folder (that compiles and installs this code), before
re-running any `zkstack` command.

#### zk init
#### Containers

As first step, it gets the docker images for postgres and reth.
The first step to initialize a ZK Stack ecosystem is to run the command `zkstack containers`. This command gets the
docker images for `postgres` and `reth`. If the `--observability` option is passed to the command, or the corresponding
option is selected in the interactive prompt, then Prometheus, Grafana and other observability-related images are
downloaded and run.

Reth (one of the Ethereum clients) will be used to setup our own copy of L1 chain (that our local ZKsync would use).

Postgres is one of the two databases, that is used by ZKsync (the other one is RocksDB). Currently most of the data is
stored in postgres (blocks, transactions etc) - while RocksDB is only storing the state (Tree & Map) - and it used by
VM.

Then we compile JS packages (these include our web3 sdk, tools and testing infrastructure).
#### Ecosystem

Then L1 & L2 contracts.
The next step is to run the command `zkstack ecosystem init`.

And now we're ready to start setting up the system.
This command:

- Collects and finalize the ecosystem configuration.
- Builds and deploys L1 & L2 contracts.
- Initializes each chain defined in the `/chains` folder. (Currently, a single chain `era` is defined there, but you can
create your own chains running `zkstack chain create`).
- Sets up observability.
- Runs the genesis process.
- Initializes the database.

#### Postgres

Expand Down Expand Up @@ -83,8 +95,8 @@ If everything goes well, you should see that L1 blocks are being produced.

Now we can start the main server:

```shell
zk server
```bash
zkstack server
```

This will actually run a cargo binary (`zksync_server`).
Expand All @@ -96,7 +108,7 @@ Currently we don't send any transactions there (so the logs might be empty).

But you should see some initial blocks in postgres:

```
```sql
select * from miniblocks;
```

Expand All @@ -107,7 +119,7 @@ Let's finish this article, by taking a look at our L1:
We will use the `web3` tool to communicate with the L1, have a look at [02_deposits.md](02_deposits.md) for installation
instructions. You can check that you're a (localnet) crypto trillionaire, by running:

```shell
```bash
./web3 --rpc-url http://localhost:8545 balance 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049
```

Expand All @@ -120,14 +132,14 @@ In order to communicate with L2 (our ZKsync) - we have to deploy multiple contra
Ethereum). You can look on the `deployL1.log` file - to see the list of contracts that were deployed and their accounts.

First thing in the file, is the deployer/governor wallet - this is the account that can change, freeze and unfreeze the
contracts (basically the owner). You can also verify (using the getBalance method above), that is has a lot of tokens.
contracts (basically the owner). You can verify the token balance using the `getBalance` method above.

Then, there are a bunch of contracts (CRATE2_FACTOR, DIAMOND_PROXY, L1_ALLOW_LIST etc etc) - for each one, the file
contains the address.

You can quickly verify that they were really deployed, by calling:

```shell
```bash
./web3 --rpc-url http://localhost:8545 address XXX
```

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/advanced/05_how_call_works.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Since the 'call' method is only for reading data, all the calculations will happ
### Calling the 'call' method

If you need to make calls quickly, you can use the 'cast' binary from the
[foundry](https://github.com/foundry-rs/foundry) suite:
[Foundry ZKsync](https://foundry-book.zksync.io/getting-started/installation) suite:

```shell=
cast call 0x23DF7589897C2C9cBa1C3282be2ee6a938138f10 "myfunction()()" --rpc-url http://localhost:3050
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/advanced/91_docker_and_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ zk

After this, you can run any commands you need.

When you see a command like `ci_run zk contract build` in the CI - this simply means that it executed
`zk contract build` inside that docker container.
When you see a command like `ci_run zkstack dev contracts` in the CI - this simply means that it executed
`zkstack dev contracts` inside that docker container.

**IMPORTANT** - by default, docker is running in the mode, where it does NOT persist the changes. So if you exit that
shell, all the changes will be removed (so when you restart, you'll end up in the same pristine condition). You can
Expand Down
Loading
Loading