Skip to content

Commit fcdece1

Browse files
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into km/more-sharon-updates
2 parents 170ea2f + fefc732 commit fcdece1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1426
-218
lines changed

docs/cdk/architecture/type-1-prover/intro-t1-prover.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
The Polygon Type 1 Prover is a zk-evm proving component used for creating proofs on your ZK-EVM chain. It has been developed in collaboration with the Toposware team.
22

3+
!!! info
4+
The Polygon Type 1 Prover is not yet ready for full implementation into a CDK stack.
5+
36
## Get started
47

58
If you want to get up and running quickly, follow the [how to deploy the Type 1 Prover guide](../../how-to/deploy-t1-prover.md).

docs/cdk/get-started/deploy-validium/contracts/deploy-contracts.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,8 @@ sepolia: {
160160
count: 20,
161161
},
162162
},
163-
```
163+
```
164+
165+
## Steps to run the node and services
166+
167+
You are now ready to begin the [CDK validum node and services deployment steps](../node/prerequisites.md).
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
## Hardware
22

3+
Make sure you have the following minimum hardware requirements.
4+
35
- A Linux-based OS (e.g., Ubuntu Server 22.04 LTS).
46
- At least 8GB RAM with a 2-core CPU.
57
- An AMD64 architecture system.
68

79
## Software
810

9-
Make sure you have the following software:
11+
Make sure you have the following minimum software requirements.
1012

11-
| Download link | Version | Check version |
13+
| Download link | Version | Check version |
1214
| --- | --- | --- |
1315
| [Node](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) | ^20 | `node --version` |
1416
| npm | ^10 | `npm --version` |
@@ -17,10 +19,13 @@ Make sure you have the following software:
1719

1820
## Sepolia access
1921

22+
!!! info
23+
You can run your own Sepolia node if you wish and we recommend this for a production set up. However, for simplicity and brevity, we demonstrate by using a node provider.
24+
2025
You will need the following:
2126

22-
- A Sepolia node RPC URL: e.g. https://sepolia.infura.io/v3/YOUR-INFURA-API-KEY
23-
- An account holding minimum 2 Sepolia ETH that you can send to a generated address within CDK.
27+
- A Sepolia node RPC URL: e.g. https://sepolia.infura.io/v3/YOUR-INFURA-API-KEY.
28+
- An account holding a minimum of 2 Sepolia ETH that you must send to a generated address to make for contract calls.
2429

2530
### Faucets
2631

@@ -32,19 +37,30 @@ Use a public faucet to get Sepolia test ETH.
3237

3338
## Configuration files
3439

35-
Create a folder `/tmp/cdk/` to store configuration files.
40+
We will be working with two separate `.env` files.
41+
42+
- One `.env` file resides in the contracts project directory. We will set this up in the [contract set up](set-up.md#create-the-contracts-env-configuration) section.
43+
- Another `.env` resides in a shared system directory so that it is accessible to the node and all running processes.
44+
45+
Create a folder `/tmp/cdk/` to store the shared `.env` file which will be used by all running processes.
3646

3747
```bash
3848
mkdir /tmp/cdk/
3949
```
4050

41-
## Environment variables
51+
!!! danger
52+
- Any files in the `tmp/` directory are deleted on shutdown.
53+
- For this reason, we recommend that you save this folder in your home directory once the shared configuration set up is complete.
54+
55+
### Shared environment variables
56+
57+
Create a `.env` file to store the environment variables that all running processes will share. This shared `.env` file allows us to use `jq` and `tomlq` to easily setup the configuration for the node and running processes.
4258

43-
Create a `.env` file to store environment variables we will use later on.
59+
After adding a few variables to this file in the next [set up section](set-up.md#create-the-shared-system-env-configuration), this file is populated with more environment variables during the [node set up step](../node/set-up.md) and is then accessed by the system throughout the [deploy node configuration step](../node/configure-deployment.md) and [node and services run step](../node/run-node-services.md).
4460

4561
```bash
4662
nano /tmp/cdk/.env
4763
```
4864

4965
!!! danger
50-
The system removes this file on shutdown.
66+
Don't forget: The system removes this file on shutdown.

docs/cdk/get-started/deploy-validium/contracts/set-up.md

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010

1111
2. Download the `0.0.2` release from the [cdk-validium-contracts github repo](https://github.com/0xPolygon/cdk-validium-contracts/releases/tag/v0.0.2-RC1).
1212

13-
!!! note
14-
The download is available in both `.tar.gz` and `.zip` formats.
15-
1613
```bash
1714
curl -L -o cdk-validium-contracts.tar.gz https://github.com/0xPolygon/cdk-validium-contracts/archive/refs/tags/v0.0.2.tar.gz
1815
```
16+
!!! note
17+
The download is available in both `.tar.gz` and `.zip` formats.
1918

2019
3. Extract the files and cd into the repo.
2120

@@ -30,15 +29,9 @@
3029
npm install
3130
```
3231

33-
## Create the .env configuration
34-
35-
1. Copy the environment configuration example file into a new `.env` file.
36-
37-
```bash
38-
cp .env.example .env
39-
```
32+
## Create the contracts `.env` configuration
4033

41-
2. Generate a new mnemonic using `cast`.
34+
1. Generate a mnemonic, address, and private key using `cast`.
4235

4336
```bash
4437
cast wallet new-mnemonic --words 12
@@ -58,29 +51,65 @@ npm install
5851
Private key: 0x3b01870a8449ada951f59c0275670bea1fc145954ee7cb1d46f7d21533600726
5952
```
6053

61-
3. Add the environment variables to the `.env` file.
54+
2. Copy the contract environment configuration example file into a new `.env` file.
55+
56+
!!! important
57+
You should still be in the `cdk-validium-contracts-0.0.2/` directory from the previous step.
6258

6359
```bash
64-
nano .env
65-
MNEMONIC="<generated mnemonic>" # copy/paste the generated Phrase
66-
INFURA_PROJECT_ID="<INFURA_PROJECT_ID>" # Generate a project id on [Infura](https://www.infura.io/)
60+
cp .env.example .env
61+
```
62+
63+
3. Open the `.env` file.
64+
65+
!!! important
66+
You should still be in the `cdk-validium-contracts-0.0.2/` directory from the previous step.
67+
68+
```sh
69+
nano `.env`
70+
```
71+
72+
4. This is what the `.env` file will more or less look like, although you may see actual data in there from a previous run.
73+
74+
```txt
75+
MNEMONIC="<GENERATED_MNEMONIC>" # copy/paste the generated Phrase from cast
76+
INFURA_PROJECT_ID="<YOUR_INFURA_API_KEY>" # Generate a project id on [Infura](https://www.infura.io/)
6777
ETHERSCAN_API_KEY="<ETHERSCAN_API_KEY>" # Generate an API key on [Etherscan](https://etherscan.io)
6878
```
6979

80+
Replace the variables as follows:
81+
82+
- `GENERATED_MNEMONIC` is the generated mnemonic phrase from the cast step above.
83+
- `YOUR_INFURA_API_KEY` is a project id you have already created on Infura Sepolia.
84+
- `ETHERSCAN_API_KEY` is an API key you have already generated on Etherscan. This variable is optional.
85+
7086
!!! info
71-
Check our documentation if you want to [use a different node provider](deploy-contracts.md#use-a-different-node-provider).
87+
Check the documentation if you want to [use a different node provider](deploy-contracts.md#use-a-different-node-provider).
7288

73-
4. Send 2 Sepolia ETH to the generated address.
89+
## Create the shared system `.env` configuration
7490

75-
5. Add the following variables to `/var/tmp/cdk/.env`.
91+
1. Now open the *other* `.env` file residing in `/tmp/cdk/.env` which we created in the prerequisite steps.
7692

77-
```bash
93+
```sh
7894
nano /tmp/cdk/.env
79-
TEST_ADDRESS="<the address generated by cast>"
80-
TEST_PRIVATE_KEY="<the private key generated by cast>"
81-
L1_URL="https://sepolia.infura.io/v3/<YOUR INFURA PROJECT ID>"
82-
L1_WS_URL="wss://sepolia.infura.io/ws/v3/<YOUR INFURA PROJECT ID>"
8395
```
84-
!!! important
85-
This step allows us to use `jq` and `tomlq` later on to setup our configuration files.
8696

97+
2. Below is what the `.env` file will more or less look like, although you may see actual data in there from a previous run.
98+
99+
```sh
100+
TEST_ADDRESS="<the address generated by cast above>"
101+
TEST_PRIVATE_KEY="<the private key generated by cast above>"
102+
L1_URL="https://sepolia.infura.io/v3/<YOUR_INFURA_API_KEY>" # same as in the other env file
103+
L1_WS_URL="wss://sepolia.infura.io/ws/v3/<YOUR_INFURA_API_KEY>" # same as in the other env file
104+
```
105+
106+
Replace the following variables:
107+
108+
- `TEST_ADDRESS` is the address generated by cast above.
109+
- `TEST_PRIVATE_KEY` is the private key generated by cast above.
110+
- `L1_URL` is your Infura Sepolia RPC URL, for example: https://sepolia.infura.io/v3/<YOUR_INFURA_API_KEY>
111+
- `L1_WS_URL` is your Infura Sepolia wss URL, for example: wss://sepolia.infura.io/ws/v3/<YOUR_INFURA_API_KEY>
112+
113+
## Send Sepolia
114+
115+
Send 2 Sepolia ETH to the cast generated address called `TEST_ADDRESS` in the shared `.env` file above.

docs/cdk/get-started/deploy-validium/index.md

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This guide takes you through the process of deploying a full CDK validium, EVM-compatible network on Sepolia.
2+
3+
We have hidden most of the configuration complexity in scripts to make the process straightforward and easy to follow.
4+
5+
## Process steps
6+
7+
The process requires two separate flows with different software requirements. For this reason, we have separated the instructions into two distinct sections.
8+
9+
1. [Deploying the contracts](contracts/prerequisites.md): The node and services require a bunch of [deployed contracts](https://github.com/0xPolygon/cdk-validium-contracts) so we complete this step first.
10+
2. [Deploying the node and services](node/prerequisites.md): Once the contracts are deployed, we can run the [validium node](https://github.com/0xPolygon/cdk-validium-node), [mock prover](https://github.com/0xPolygonHermez/zkevm-prover), [data availability layer](https://github.com/0xPolygon/cdk-data-availability), and [zkEVM bridge service](https://github.com/0xPolygonHermez/zkevm-bridge-service).
11+
12+
!!! warning
13+
- The instructions are subject to frequent updates as the software remains at an early development stage.
14+
- Report any technical issue on the relevant [repo](#git-repos-and-running-order).
15+
- Report any content issues on our docs repo: https://github.com/0xPolygon/polygon-docs.
16+
17+
## Git repos and running order
18+
19+
These are code bases we used to set everything up for this deployment guide, and in this order.
20+
21+
!!! warning
22+
The versions below may not be the most recent.
23+
24+
| Repo | Version |
25+
| --- | --- |
26+
| https://github.com/0xPolygon/cdk-validium-contracts/releases/tag/v0.0.2 | v0.0.2 |
27+
| https://github.com/0xPolygon/cdk-validium-node/releases/tag/v0.0.3 | v0.0.3 |
28+
| https://github.com/0xPolygonHermez/zkevm-prover | v3.0.2 |
29+
| https://github.com/0xPolygon/cdk-data-availability | v0.0.3 |
30+
| https://github.com/0xPolygonHermez/zkevm-bridge-service | v0.3.1 |
31+
32+
## Instructions for deploying contracts
33+
34+
You are now ready to follow the [pre-requisite steps](contracts/prerequisites.md) for setting up the contracts.

docs/cdk/get-started/deploy-validium/node/configure-deployment.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,17 @@ jq '.aggregatorClientHost = "127.0.0.1" | .databaseURL = "postgresql://cdk_user:
225225

226226
The values to append to `genesis.json` are something like:
227227

228-
```bash
229-
#~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/genesis.json
230-
"L1Config": {
231-
"chainId": 11155111,
232-
"maticTokenAddress": "0xd76B50509c1693C7BA35514103a0A156Ca57980c",
233-
"polygonZkEVMAddress": "0x52C8f9808246eF2ce992c0e1f04fa54ec3378dD1",
234-
"cdkDataCommitteeContract": "0x8346026951978bd806912d0c93FB0979D8E3436a",
235-
"polygonZkEVMGlobalExitRootAddress": "0xE3A721c20B30213FEC306dd60f6c7F2fCB8b46D2"
236-
},
237-
"genesisBlockNumber": 5098088
238-
```
228+
```bash
229+
#~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/genesis.json
230+
"L1Config": {
231+
"chainId": 11155111,
232+
"maticTokenAddress": "0xd76B50509c1693C7BA35514103a0A156Ca57980c",
233+
"polygonZkEVMAddress": "0x52C8f9808246eF2ce992c0e1f04fa54ec3378dD1",
234+
"cdkDataCommitteeContract": "0x8346026951978bd806912d0c93FB0979D8E3436a",
235+
"polygonZkEVMGlobalExitRootAddress": "0xE3A721c20B30213FEC306dd60f6c7F2fCB8b46D2"
236+
},
237+
"genesisBlockNumber": 5098088
238+
```
239239

240240
6. Run the following script that automates the process of appending those values:
241241

@@ -330,8 +330,12 @@ Now let’s configure the Data Availability Committee.
330330
$TEST_ADDRESS
331331
```
332332

333-
!!! note
334-
This can take a few minutes.
333+
!!! note
334+
This can take a few minutes.
335+
336+
You should see something like this:
337+
338+
![DAC configuration output](../../../../img/cdk/dac-output.png)
335339

336340
## Configure bridge service
337341

docs/cdk/get-started/deploy-validium/node/prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@
9393
./version-check.sh
9494
```
9595

96-
3. Install any missing or out-of-date software.
96+
3. Install any missing or out-of-date software using the links provided above.

0 commit comments

Comments
 (0)