Skip to content

Commit 600832c

Browse files
edits
1 parent 10cb4aa commit 600832c

File tree

1 file changed

+89
-74
lines changed

1 file changed

+89
-74
lines changed
Lines changed: 89 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,57 @@
1+
The following quick start guide shows you how to deploy a CDK rollup (zkevm-node) on your local machine and runs the following components:
2+
3+
- zkEVM node databases
4+
- Explorer databases
5+
- L1 network
6+
- Prover
7+
- zkEVM node components
8+
- Explorers
9+
110
!!! note
211
- The documentation describes standard deployments.
312
- Edit the configuration files to implement your own custom setups.
413

5-
## Run a CDK rollup locally
14+
## Prerequisites
615

7-
The following is a quickstart guide for deploying a CDK rollup (zkevm-node) on your local machine.
16+
!!! warning
17+
- Currently the executor/prover does not run on ARM-powered Macs.
18+
- For Windows users, WSL/WSL2 use is not recommended.
819

9-
# Steps to run/develop on the environment locally
20+
Make sure you have installed the following:
1021

11-
# Warning:
22+
- [`go`](https://go.dev/doc/install)
23+
- [`docker`](https://www.docker.com/get-started)
24+
- [`docker-compose`](https://docs.docker.com/compose/install/)
1225

13-
>Currently the Executor/Prover does not run on ARM-powered Macs. For Windows users, WSL/WSL2 use is not recommended.
26+
## Set up
1427

15-
## Overview
28+
Clone the repo:
1629

17-
This documentation will help run the following components:
18-
19-
- zkEVM Node Databases
20-
- Explorer Databases
21-
- L1 Network
22-
- Prover
23-
- zkEVM Node components
24-
- Explorers
25-
26-
## Requirements
27-
28-
The current version of the environment requires `go`, `docker` and `docker-compose` to be previously installed, check the links below to understand how to install them:
29-
30-
- <https://go.dev/doc/install>
31-
- <https://www.docker.com/get-started>
32-
- <https://docs.docker.com/compose/install/>
30+
```sh
31+
git clone https://github.com/0xPolygonHermez/zkevm-node.git
32+
cd zkevm-node
33+
```
3334

34-
The `zkevm-node` docker image must be built at least once and every time a change is made to the code.
35-
If you haven't build the `zkevm-node` image yet, you must run:
35+
Build the `zkevm-node` docker image:
3636

3737
```bash
3838
make build-docker
3939
```
4040

41-
## A look at how the binary works:
41+
!!! info
42+
The `zkevm-node` docker image must be built at least once and every time a change is made to the code.
43+
44+
!!! important "What's happening under the hood"
4245

43-
The `zkevm-node` allows certain commands to interact with smart contracts, run certain components, create encryption files and print out debug information.
46+
The `zkevm-node` has commands that interact with smart contracts, run components, create encryption files, and print out debug information.
4447

45-
To interact with the binary program we provide docker compose files, and a Makefile to spin up/down the different services and components, ensuring a smooth deployment locally and better interface in command line for developers.
48+
To interact with the binary program we provide docker compose files, and a Makefile to spin up/down the different services and components, ensuring a smooth deployment locally with a command line interface.
4649

4750
## Controlling the environment
4851

49-
> All the data is stored inside of each docker container, this means once you remove the container, the data will be lost.
52+
!!! important
53+
- All the data is stored inside Docker containers.
54+
- This means that you lose all the data when you remove the container.
5055

5156
To run the environment:
5257

@@ -76,142 +81,149 @@ make restart
7681

7782
## Sample data
7883

79-
The `make run` will execute the containers needed to run the environment but this will not execute anything else, so the L2 will be basically empty.
84+
`make run` spins up the containers needed to run the environment but this doesn't do anything else, so the L2 is empty at this stage.
8085

81-
If you need sample data already deployed to the network, we have the following scripts:
86+
To deploy sample data, use the following scripts:
8287

83-
**To add some examples of transactions and smart contracts:**
88+
### Add example transactions and smart contracts
8489

8590
```bash
8691
make deploy-sc
8792
```
8893

89-
**To deploy a full uniswap environment:**
94+
### Deploy a full Uniswap environment
9095

9196
```bash
9297
make deploy-uniswap
9398
```
9499

95-
**To grant the Pol smart contract a set amount of tokens, run:**
100+
### Grant the Pol smart contract a set amount of tokens
96101

97102
```bash
98103
make run-approve-pol
99104
```
100105

101106
## Accessing the environment
102107

103-
- **Databases**:
108+
### Databases
109+
104110
- zkEVM Node *State* Database
105111
- `Type:` Postgres DB
106112
- `User:` state_user
107113
- `Password:` state_password
108114
- `Database:` state-db
109115
- `Host:` localhost
110116
- `Port:` 5432
111-
- `Url:` <postgres://state_user:srare_password@localhost:5432/state-db>
117+
- `URL:` <postgres://state_user:srare_password@localhost:5432/state-db>
112118
- zkEVM Node *Pool* Database
113119
- `Type:` Postgres DB
114120
- `User:` pool_user
115121
- `Password:` pool_password
116122
- `Database:` pool_db
117123
- `Host:` localhost
118124
- `Port:` 5433
119-
- `Url:` <postgres://pool_user:pool_password@localhost:5433/pool_db>
125+
- `URL:` <postgres://pool_user:pool_password@localhost:5433/pool_db>
120126
- zkEVM Node *JSON-RPC* Database
121127
- `Type:` Postgres DB
122128
- `User:` rpc_user
123129
- `Password:` rpc_password
124130
- `Database:` rpc_db
125131
- `Host:` localhost
126132
- `Port:` 5434
127-
- `Url:` <postgres://rpc_user:rpc_password@localhost:5434/rpc_db>
133+
- `URL:` <postgres://rpc_user:rpc_password@localhost:5434/rpc_db>
128134
- Explorer L1 Database
129135
- `Type:` Postgres DB
130136
- `User:` l1_explorer_user
131137
- `Password:` l1_explorer_password
132138
- `Database:` l1_explorer_db
133139
- `Host:` localhost
134140
- `Port:` 5435
135-
- `Url:` <postgres://l1_explorer_user:l1_explorer_password@localhost:5435/l1_explorer_db>
141+
- `URL:` <postgres://l1_explorer_user:l1_explorer_password@localhost:5435/l1_explorer_db>
136142
- Explorer L2 Database
137143
- `Type:` Postgres DB
138144
- `User:` l2_explorer_user
139145
- `Password:` l2_explorer_password
140146
- `Database:` l2_explorer_db
141147
- `Host:` localhost
142148
- `Port:` 5436
143-
- `Url:` <postgres://l2_explorer_user:l2_explorer_password@localhost:5436/l2_explorer_db>
144-
- **Networks**:
149+
- `URL:` <postgres://l2_explorer_user:l2_explorer_password@localhost:5436/l2_explorer_db>
150+
151+
### Networks
152+
145153
- L1 Network
146154
- `Type:` Geth
147155
- `Host:` localhost
148156
- `Port:` 8545
149-
- `Url:` <http://localhost:8545>
157+
- `URL:` <http://localhost:8545>
150158
- zkEVM Node
151159
- `Type:` JSON RPC
152160
- `Host:` localhost
153161
- `Port:` 8123
154-
- `Url:` <http://localhost:8123>
155-
- **Explorers**:
162+
- `URL:` <http://localhost:8123>
163+
164+
### Explorers
165+
156166
- Explorer L1
157167
- `Type:` Web
158168
- `Host:` localhost
159169
- `Port:` 4000
160-
- `Url:` <http://localhost:4000>
170+
- `URL:` <http://localhost:4000>
161171
- Explorer L2
162172
- `Type:` Web
163173
- `Host:` localhost
164174
- `Port:` 4001
165-
- `Url:` <http://localhost:4001>
166-
- Prover
167-
- `Type:` Mock
168-
- `Host:` localhost
169-
- `Port:` Depending on the prover image, if it's mock or not:
170-
- Prod prover: 50052 for Prover, 50061 for Merkle Tree, 50071 for Executor
171-
- Mock prover: 43061 for MT, 43071 for Executor
172-
- `Url:` <http://localhost:50001>
173-
## Metamask
174-
175-
> Metamask requires the network to be running while configuring it, so make sure your network is running before starting.
176-
177-
To configure your Metamask to use your local environment, follow these steps:
178-
179-
1. Log in to your Metamask wallet
180-
2. Click on your account picture and then on Settings
181-
3. On the left menu, click on Networks
182-
4. Click on `Add Network` button
183-
5. Fill up the L2 network information
175+
- `URL:` <http://localhost:4001>
176+
- Prover
177+
- `Type:` Mock
178+
- `Host:` localhost
179+
- `Port:` Depending on the prover image, if it's mock or not:
180+
- Prod prover: 50052 for Prover, 50061 for Merkle Tree, 50071 for Executor
181+
- Mock prover: 43061 for MT, 43071 for Executor
182+
- `URL:` <http://localhost:50001>
183+
184+
## MetaMask
185+
186+
!!! info
187+
Metamask requires the network to be running while configuring it, so make sure your network is running before starting.
188+
189+
To configure MetaMask to use your local environment, follow these steps:
190+
191+
1. Log in to your MetaMask wallet.
192+
2. Click your account picture and then on **Settings**.
193+
3. On the left menu, click **Networks**.
194+
4. Click the **Add Network** button.
195+
5. Enter the following L2 network information:
184196
1. `Network Name:` Polygon zkEVM - Local
185197
2. `New RPC URL:` <http://localhost:8123>
186198
3. `ChainID:` 1001
187199
4. `Currency Symbol:` ETH
188200
5. `Block Explorer URL:` <http://localhost:4000>
189-
6. Click on Save
190-
7. Click on `Add Network` button
191-
8. Fill up the L1 network information
201+
6. Click **Save**.
202+
7. Click the **Add Network** button,
203+
8. Enter the following L1 network information:
192204
1. `Network Name:` Geth - Local
193205
2. `New RPC URL:` <http://localhost:8545>
194206
3. `ChainID:` 1337
195207
4. `Currency Symbol:` ETH
196-
9. Click on Save
208+
9. Click **Save**.
197209

198-
## L1 Addresses
210+
## L1 addresses
199211

200212
| Address | Description |
201213
|---|---|
202-
| 0x8dAF17A20c9DBA35f005b6324F493785D239719d | Polygon ZKEVM |
203-
| 0x40E0576c0A7dff9dc460B29ba73e79aBf73dD2a9 | Polygon Bridge |
214+
| 0x8dAF17A20c9DBA35f005b6324F493785D239719d | Polygon zkEVM |
215+
| 0x40E0576c0A7dff9dc460B29ba73e79aBf73dD2a9 | Polygon bridge |
204216
| 0x5FbDB2315678afecb367f032d93F642f64180aa3 | Pol token |
205217
| 0x8A791620dd6260079BF849Dc5567aDC3F2FdC318 | Polygon GlobalExitRootManager |
206218
| 0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e | Polygon RollupManager |
207219

208-
## Deployer Account
220+
## Deployer account
209221

210222
| Address | Private Key |
211223
|---|---|
212224
| 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 |
213225

214-
## Sequencer Account
226+
## Sequencer account
215227

216228
| Address | Private Key |
217229
|---|---|
@@ -241,6 +253,9 @@ To configure your Metamask to use your local environment, follow these steps:
241253
| 0xdD2FD4581271e230360230F9337D5c0430Bf44C0 | 0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0 |
242254
| 0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199 | 0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e |
243255

244-
245-
256+
<!--
257+
This quick start is from here:
246258
[https://github.com/0xPolygonHermez/zkevm-node/blob/develop/docs/running_local.md](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/docs/running_local.md)
259+
Need to remove it from there and add a link to docs.
260+
>
261+

0 commit comments

Comments
 (0)