Skip to content

Commit d76d1de

Browse files
commit changes
1 parent b998e36 commit d76d1de

File tree

1 file changed

+48
-22
lines changed

1 file changed

+48
-22
lines changed

docs/cdk/getting-started/local-deployment.md

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The [Polygon CDK Kurtosis package](https://github.com/0xPolygon/kurtosis-cdk/) a
2727
And, optionally, for submitting transactions and interacting with the environment once set up, we are using:
2828

2929
- [Foundry](https://book.getfoundry.sh/getting-started/installation)
30-
- [yq](https://github.com/mikefarah/yq)
30+
- [yq](https://github.com/mikefarah/yq) (v3)
3131
- [jq](https://stedolan.github.io/jq/)
3232
- [polyon-cli](https://github.com/0xPolygon/polygon-cli)
3333

@@ -54,11 +54,13 @@ It defines the following steps for the deployment process:
5454
|-------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
5555
| 1 | Deploy a local layer 1 Ethereum chain | [ethereum.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/ethereum.star) | True |
5656
| 2 | Deploy the CDK smart contracts on the L1 | [deploy_zkevm_contracts.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/deploy_zkevm_contracts.star) | True |
57-
| 3 | Deploy the central environment, prover, and CDK erigon or zkEVM node databases | [databases.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/databases.star) | True |
58-
| 4 | Deploy the CDK central environment | [cdk_central_environment.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/cdk_central_environment.star) | True |
59-
| 5 | Deploy the CDK erigon package | [cdk_erigon.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/cdk_erigon.star) - included in step 4 deployment | True |
60-
| 6 | Deploy the bridge infrastructure | [cdk_bridge_infrastructure.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/cdk_bridge_infra.star) | True |
61-
| 7 | Deploy the AggLayer | [agglayer.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/agglayer.star) | True |
57+
| 3 | Deploy the central environment, prover, and CDK erigon or zkEVM node databases | [databases.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/databases.star)
58+
| 4 | Get the genesis file | n/a | False |
59+
| 5 | Deploy the CDK central environment | [cdk_central_environment.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/cdk_central_environment.star) | True |
60+
| 6 | Deploy the CDK erigon package | [cdk_erigon.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/cdk_erigon.star) - included in step 4 deployment | True |
61+
| 7 | Deploy the bridge infrastructure | [cdk_bridge_infrastructure.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/cdk_bridge_infra.star) | True |
62+
| 8 | Deploy the AggLayer | [agglayer.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/agglayer.star) | True |
63+
| 9 | Additional services | Explorers, reporting, permissionless zkEVM node | False |
6264
| - | Input parser tool to help deployment stages | [input_parser.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/input_parser.star) - deployed immediately | n/a |
6365
| - | zkEVM pool manager tool | [zkevm_pool_manager.star](https://github.com/0xPolygon/kurtosis-cdk/blob/main/zkevm_pool_manager.star) - deployed with CDK erigon node | n/a |
6466

@@ -88,23 +90,21 @@ You can modify each of these parameters to customize the chain to your specific
8890
2. In the `kurtosis-cdk` directory, use the [kurtosis run](https://docs.kurtosis.com/run) command to deploy the chain on your local machine by executing the `main.star` script provided with the `params.yml` configuration file:
8991

9092
```bash
91-
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
93+
kurtosis run --enclave cdk .
9294
```
9395

94-
- `enclave cdk-v1` specifies the name of the enclave, or isolated environment, to use for the deployment process.
95-
- `args-file params.yml` specifies the configuration file to use for the deployment process.
96-
- `image-download` specifies to always download the latest Docker images for the deployment process.
97-
9896
3. This command typically takes a while to complete and outputs the logs of each step in the deployment process for you to monitor the progress of the chain setup. Once the command is complete, you should see the following output:
9997

10098
```bash
10199
Starlark code successfully run. No output was returned.
102100
103-
===============================================
104-
|| Created enclave: cdk-v1 ||
105-
===============================================
106-
Name: cdk-v1
101+
INFO[2024-10-16T16:10:27+02:00] ============================================
102+
INFO[2024-10-16T16:10:27+02:00] || Created enclave: cdk ||
103+
INFO[2024-10-16T16:10:27+02:00] ============================================
104+
Name: cdk
105+
UUID: 3e30c0e1863d
107106
Status: RUNNING
107+
Creation Time: Wed, 16 Oct 2024 16:01:48 CEST
108108
109109
========================================= Files Artifacts =========================================
110110
@@ -121,7 +121,7 @@ You can modify each of these parameters to customize the chain to your specific
121121
Run the following command to see the status of the enclave and the services running within it at any time.
122122

123123
```sh
124-
kurtosis enclave inspect cdk-v1
124+
kurtosis enclave inspect cdk
125125
```
126126

127127
## Interacting with the chain
@@ -152,23 +152,49 @@ Let's do some read and write operations and test transactions on the L2 with Fou
152152
cast send --legacy --value 0.01ether 0x0000000000000000000000000000000000000000 --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
153153
```
154154
155-
!!! info
156-
The `0xE34...9970` and `0x12d...c625` public-private key pair used in the above commands is the default admin account configured in `params.yml`.
157-
158155
### Load testing the chain
159156
157+
!!! tip
158+
You may need to adjust the various commands slightly if you deployed the legacy zkevm-node as the sequencer. You should target the zkevm-node-rpc-001 service instead of cdk-erigon-node-001
159+
160160
1. Export the RPC URL of your L2 to an environment variable called `ETH_RPC_URL` with the following command:
161161
162162
```bash
163-
export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-node-001 http-rpc)"
163+
eexport ETH_RPC_URL="$(kurtosis port print cdk cdk-erigon-node-001 rpc)"
164164
```
165165
166-
2. Use the [`polycli loadtest`](https://github.com/maticnetwork/polygon-cli/blob/main/doc/polycli_loadtest.md) command to send multiple transactions at once to the chain to test its performance:
166+
2. Let's send a transaction with cast:
167167

168168
```bash
169-
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --verbosity 700 --requests 500 --rate-limit 5 --mode t --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
169+
export PK="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
170+
cast send --legacy --private-key "$PK" --value 0.01ether 0x0000000000000000000000000000000000000000
170171
```
171172

173+
3. Use the [`polycli loadtest`](https://github.com/maticnetwork/polygon-cli/blob/main/doc/polycli_loadtest.md) command to send multiple transactions at once to the chain to test its performance:
174+
175+
```bash
176+
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 50000 --rate-limit 50 --concurrency 5 --mode t
177+
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode 2
178+
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 3 --mode uniswapv3
179+
```
180+
181+
### Grab some logs
182+
183+
Add the service name to the following command to grab the logs you're interested in.
184+
185+
```bash
186+
kurtosis service logs cdk agglayer --follow
187+
```
188+
189+
### Open a shell on a service
190+
191+
To open a shell to examine a service, add the service name to the following command.
192+
193+
```bash
194+
kurtosis service shell cdk contracts-001
195+
jq . /opt/zkevm/combined.json
196+
```
197+
172198
### Viewing transaction finality
173199
174200
A common way to check the status of the system is by ensuring that batches are sent and verified on the L1 chain.

0 commit comments

Comments
 (0)