Skip to content

Commit 8c14c25

Browse files
Merge pull request 0xPolygon#364 from 0xPolygon/cdk/rollup-qs
CDK: fix the quickstart rollup guide
2 parents 773b138 + c77836f commit 8c14c25

File tree

1 file changed

+85
-19
lines changed

1 file changed

+85
-19
lines changed

docs/cdk/get-started/quickstart-rollup.md

Lines changed: 85 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
comments: true
33
---
44

5-
This quick start guide shows you how to deploy a CDK rollup (EVM compatible) environment on your local machine that sets up and runs the following components:
5+
This quick start guide shows you how to deploy a CDK rollup (EVM compatible) environment on your local machine.
66

7-
- zkEVM node databases
8-
- Explorer databases
9-
- L1 network
10-
- Prover
11-
- zkEVM node components
12-
- Explorers
7+
It sets up and runs the following components:
8+
9+
- Prover: `zkevm-prover`
10+
- zkEVM node components: `zkevm-sync`, `zkevm-eth-tx-manager`, `zkevm-sequencer`, `zkevm-sequence-sender`, `zkevm-l2gaspricer`, `zkevm-aggregator`, `zkevm-json-rpc`
11+
- L1 network: `zkevm-mock-l1-network`
12+
- zkEVM node databases: `zkevm-event-db`, `zkevm-pool-db`, `zkevm-state-db`
13+
- Explorer databases: `zkevm-explorer-l1-db`, `zkevm-explorer-l2-db`
14+
- Explorers: `zkevm-explorer-l1`, `zkevm-explorer-l2`, `zkevm-explorer-json-rpc`
1315

1416
!!! note
1517
- The documentation describes standard deployments.
@@ -24,9 +26,28 @@ This quick start guide shows you how to deploy a CDK rollup (EVM compatible) env
2426
- An AMD64 architecture system.
2527

2628
!!! warning
27-
- Currently the executor/prover does not run on ARM-powered Macs.
29+
- Some of the components aren't set up to run on MacOS. Please check the workaround. The explorers and the bridge service probably won't come up.
2830
- For Windows users, WSL/WSL2 use is not recommended.
2931

32+
!!! tip "MacOS workaround"
33+
You may see errors related to `amd64` such as:
34+
35+
```sh
36+
⠇ zkevm-prover
37+
no matching manifest for linux/arm64/v8 in the manifest list entries
38+
make: *** [run] Error 18
39+
```
40+
41+
If so, go to the `docker-compose.yml` file in the `test` directory, search for the component details - in this case `zkevm-prover`, and add the `platform: linux/amd64` environment variable under the `environment` variable (which you should also add if it is not there):
42+
43+
```sh
44+
environment:
45+
- EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1
46+
platform: linux/amd64
47+
```
48+
49+
You may find the explorer components affected similarly.
50+
3051
### Software
3152

3253
- [`go`](https://go.dev/doc/install) <sub>version 1.21</sub>
@@ -73,6 +94,17 @@ make run
7394

7495
The `make run` command spins up the containers that run the environment, but nothing else. This means that the L2 has no data yet.
7596

97+
#### Run the explorers
98+
99+
!!! warning
100+
The L2 explorer may not come up on MacOS regardless of environment variables.
101+
102+
You need to bring up the explorer databases and networks separately:
103+
104+
```sh
105+
make run-explorer-db run-explorer
106+
```
107+
76108
### 3.2 Stop the environment
77109

78110
```bash
@@ -89,41 +121,74 @@ make restart
89121

90122
### 4.1 Add example transactions and smart contracts
91123

124+
This example builds and deploys contracts, funds accounts, and sends some transactions.
125+
92126
```bash
93127
make deploy-sc
94128
```
95129

130+
You should see output similar to this:
131+
132+
```sh
133+
2024-04-17T10:05:17.729+0200 INFO deploy_sc/main.go:42 connecting to Local L1: http://localhost:8545 {"pid": 16869, "version": "v0.1.0"}
134+
2024-04-17T10:05:17.729+0200 INFO deploy_sc/main.go:45 connected {"pid": 16869, "version": "v0.1.0"}
135+
2024-04-17T10:05:17.735+0200 DEBUG deploy_sc/main.go:54 ETH Balance for 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266: 999899846763612022461 {"pid": 16869, "version": "v0.1.0"}
136+
2024-04-17T10:05:17.735+0200 DEBUG deploy_sc/main.go:57 Sending TX to deploy Counter SC {"pid": 16869, "version": "v0.1.0"}
137+
2024-04-17T10:05:19.763+0200 DEBUG operations/wait.go:101 Transaction successfully mined: 0xfac2ebc78eada5141cf3737fd5c6ad399d3d18ed7a026d60e87d00c2db0d6ed9 {"pid": 16869, "version": "v0.1.0"}
138+
...
139+
```
140+
96141
### 4.2 Deploy a full Uniswap environment
97142

143+
This example builds out a Uniswap environment which creates token contracts and deploys them, mines tokens, and performs token swaps.
144+
98145
```bash
99146
make deploy-uniswap
100147
```
101148

149+
You should see output similar to this:
150+
151+
```sh
152+
2024-04-17T10:07:56.298+0200 DEBUG pkg/swap.go:40 after first swap aCoin.balanceOf[0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266]: 989999999999999999950 {"pid": 17666, "version": "v0.1.0"}
153+
2024-04-17T10:07:56.301+0200 DEBUG pkg/swap.go:43 after first swap bCoin.balanceOf[0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266]: 980000000000000000009 {"pid": 17666, "version": "v0.1.0"}
154+
2024-04-17T10:07:56.305+0200 DEBUG pkg/swap.go:46 after first swap cCoin.balanceOf[0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266]: 990000000000000000032 {"pid": 17666, "version": "v0.1.0"}
155+
2024-04-17T10:07:56.306+0200 DEBUG pkg/swap.go:47 Swaping tokens from B <-> C {"pid": 17666, "version": "v0.1.0"}
156+
2024-04-17T10:07:56.307+0200 DEBUG pkg/swap.go:62 SwapExactTokensForTokens 0x70e0bA845a1A0F2DA3359C97E0285013525FFC49 <-> 0x4826533B4897376654Bb4d4AD88B7faFD0C98528 pair: 0x09dF250580cb3ba5D061f6dfcA783cDa4caa6461 {"pid": 17666, "version": "v0.1.0"}
157+
2024-04-17T10:07:56.308+0200 DEBUG pkg/swap.go:67 SwapExactTokensForTokens 0x70e0bA845a1A0F2DA3359C97E0285013525FFC49 <-> 0x4826533B4897376654Bb4d4AD88B7faFD0C98528 reserves 0: 9999999999999999968 1: 10000000000000000036 Block Timestamp: 1713341274 {"pid": 17666, "version": "v0.1.0"}
158+
2024-04-17T10:07:56.309+0200 DEBUG pkg/swap.go:70 SwapExactTokensForTokens 0x70e0bA845a1A0F2DA3359C97E0285013525FFC49 <-> 0x4826533B4897376654Bb4d4AD88B7faFD0C98528 exactAmountIn: 9 amountOut: 8 {"pid": 17666, "version": "v0.1.0"}
159+
2024-04-17T10:07:58.338+0200 DEBUG operations/wait.go:101 Transaction successfully mined: 0x5c0a2fdb27f6c681b898101883f278dee1ee78dcdacb8471872e5b00603643fe {"pid": 17666, "version": "v0.1.0"}
160+
```
161+
102162
### 4.3 Grant the Pol smart contract a set amount of tokens
103163

104-
```bash
164+
This sets up accounts with POL and is run as part of the previous examples.
165+
166+
```sh
105167
make run-approve-pol
106168
```
107169

108170
## 5. Set up MetaMask
109171

110-
!!! info
111-
MetaMask requires the network to be running during set up.
112-
113172
To configure MetaMask to use your local environment, make sure the network is running and follow these steps.
114173

115-
- Log in to your MetaMask wallet.
116-
- Click your account picture and then on **Settings**.
117-
- On the left menu, click **Networks**.
118-
- Click the **Add Network** button.
174+
1. Log in to your MetaMask wallet.
175+
2. Click your account picture and then on **Settings**.
176+
3. On the left menu, click **Networks**.
177+
178+
### Add zkEVM L2 network
179+
180+
- Click the **Add Network** button and **Add a network manually**.
119181
- Enter the following L2 network information:
120182
1. `Network name:` Polygon zkEVM - local
121183
2. `New RPC URL:` <http://localhost:8123>
122184
3. `Chain ID:` 1001
123-
4. `Currency symbol:` ETH
185+
4. `Currency symbol:` (accept default)
124186
5. `Block explorer URL:` <http://localhost:4000>
125187
- Click **Save**.
126-
- Click the **Add Network** button,
188+
189+
### Add Geth L1 network
190+
191+
- Click the **Add Network** button and **Add a network manually**.
127192
- Enter the following L1 network information:
128193
1. `Network name:` Geth - local
129194
2. `New RPC URL:` <http://localhost:8545>
@@ -133,7 +198,8 @@ To configure MetaMask to use your local environment, make sure the network is ru
133198

134199
## Environment configurations
135200

136-
Access the running components using the following details.
201+
- Use the following details for the running components to set up your applications and tests.
202+
- You can find these details in the running logs also.
137203

138204
### Databases
139205

0 commit comments

Comments
 (0)