Skip to content

Commit 7e87613

Browse files
committed
Update Type-1 Prover docs - Running on devnet
2 parents 34662dd + 2bae063 commit 7e87613

Some content is hidden

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

49 files changed

+2018
-2177
lines changed

docs/_site_essentials/stylesheets/extra.css

Lines changed: 823 additions & 30 deletions
Large diffs are not rendered by default.

docs/_site_essentials/stylesheets/polygon-docs.webflow.css

Lines changed: 0 additions & 797 deletions
This file was deleted.

docs/cdk/get-started/deploy-rollup/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ This quick start takes you through the process of deploying a full CDK zkRollup,
22

33
!!! warning
44
- These instructions are subject to frequent updates as the software remains at an early development stage.
5-
- Report any issues on our docs repo: https://github.com/0xPolygon/polygon-docs
5+
- Report any content issues on our docs repo: https://github.com/0xPolygon/polygon-docs
66

77
The process is split into the following sections:
88

99
1. [Overview of the full environment](environment-overview.md).
1010

11-
2. [Prerequisites steps](prerequisites.md): Preliminary setup, checking system requirements, and prerequisite variables.
11+
2. [Prerequisite steps](prerequisites.md): Preliminary setup, checking system requirements, and prerequisite variables.
1212

1313
3. [Install dependencies](install-dependencies.md): Install required dependencies and downloading mainnet files.
1414

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

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
## Configure deployment parameters
2+
3+
1. `cd` to the `deployment/` directory and create a new `deploy_parameters.json` by copying the example
4+
5+
```bash
6+
cd deployment/
7+
cp deploy_parameters.json.example deploy_parameters.json
8+
```
9+
10+
2. Run the following `jq` script to streamline the process of replacing these fields:
11+
12+
```bash
13+
source /tmp/cdk/.env
14+
jq --arg TEST_ADDRESS "$TEST_ADDRESS" '.trustedSequencerURL = "http://127.0.0.1:8123" | .trustedSequencer = $TEST_ADDRESS | .trustedAggregator = $TEST_ADDRESS | .admin = $TEST_ADDRESS | .cdkValidiumOwner = $TEST_ADDRESS | .initialCDKValidiumDeployerOwner = $TEST_ADDRESS | .timelockAddress = $TEST_ADDRESS | .forkID = 6' ./deploy_parameters.json.example > ./deploy_parameters.json
15+
```
16+
17+
3. The complete `deploy_parameters.json` should look something like this, where all the addresses are equal to the generated address except for `maticTokenAddress`:
18+
19+
```bash
20+
nano ~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/deploy_parameters.json
21+
# ~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/deploy_parameters.json
22+
{
23+
"realVerifier": false,
24+
"trustedSequencerURL": "http://127.0.0.1:8123,
25+
"networkName": "cdk-validium",
26+
"version":"0.0.1",
27+
"trustedSequencer":"0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
28+
"chainID": 1001,
29+
"trustedAggregator":"0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
30+
"trustedAggregatorTimeout": 604799,
31+
"pendingStateTimeout": 604799,
32+
"forkID": 6,
33+
"admin":"0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
34+
"cdkValidiumOwner": "0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
35+
"timelockAddress": "0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
36+
"minDelayTimelock": 3600,
37+
"salt": "0x0000000000000000000000000000000000000000000000000000000000000000",
38+
"initialCDKValidiumDeployerOwner" :"0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
39+
"maticTokenAddress":"0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
40+
"cdkValidiumDeployerAddress":"",
41+
"deployerPvtKey": "",
42+
"maxFeePerGas":"",
43+
"maxPriorityFeePerGas":"",
44+
"multiplierGas": "",
45+
"setupEmptyCommittee": true,
46+
"committeeTimelock": false
47+
}
48+
```
49+
50+
## Deploy contracts
51+
52+
### `CDKValidiumDeployer`
53+
54+
This is a factory contract that deploys the deterministic contracts required by the system and must be deployed first.
55+
56+
The address of the contracts it creates depends on the salt and the `initialCDKValidiumDeployerOwner` inside `deploy_parameters.json`.
57+
58+
1. From the same `deployment` directory, run the deploy script.
59+
60+
```bash
61+
npm run deploy:deployer:CDKValidium:sepolia
62+
```
63+
64+
You should see something similar to this:
65+
66+
```bash
67+
cdkValidiumDeployer deployed on: 0x87572242776ccb6c98F4Cf1ff20f7e5a4e4142fF
68+
```
69+
70+
2. Now we can deploy the rest of the contract suite.
71+
72+
```bash
73+
npm run deploy:testnet:CDKValidium:sepolia
74+
```
75+
76+
!!! info
77+
This may take several minutes depending on network conditions.
78+
79+
!!! warning
80+
If you see this message, you can safely ignore it:
81+
82+
```sh
83+
cp: cannot stat '.openzeppelin/sepolia.json': No such file or directory
84+
```
85+
86+
3. On successful deployment, you should see a new directory named `deployments` containing a directory storing the information about your deployment. For example:
87+
88+
```bash
89+
# ~/cdk-validium/cdk-validium-contracts-0.0.2/deployments/sepolia_1705429054/deploy_output.json
90+
{
91+
"cdkValidiumAddress": "0x37eEBCa90363b0952e03a64979B64AAE3b8C9631",
92+
"polygonZkEVMBridgeAddress": "0x3485bfA6F27e54a8FF9782032fdbC7C555c178E4",
93+
"polygonZkEVMGlobalExitRootAddress": "0x8330E90c82F4BDDfa038041B898DE2d900e6246C",
94+
"cdkDataCommitteeContract": "0xb49d901748c3E278a634c05E0c500b23db992fb0",
95+
"maticTokenAddress": "0x20db28Bb7C779a06E4081e55808cc5DE35cca303",
96+
"verifierAddress": "0xb01Be1534d1eF82Ba98DCd5B33A3A331B6d119D0",
97+
"cdkValidiumDeployerContract": "0x87572242776ccb6c98F4Cf1ff20f7e5a4e4142fF",
98+
"deployerAddress": "0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
99+
"timelockContractAddress": "0xDa476BD0B6A660cd08239dEb620F701877688c6F",
100+
"deploymentBlockNumber": 5097689,
101+
"genesisRoot": "0xf07cd7c4f7df7092241ccb2072d9ac9e800a87513df628245657950b3af78f94",
102+
"trustedSequencer": "0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
103+
"trustedSequencerURL": "http://127.0.0.1:8123",
104+
"chainID": 1001,
105+
"networkName": "cdk-validium",
106+
"admin": "0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
107+
"trustedAggregator": "0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE",
108+
"proxyAdminAddress": "0x828E55268524c13dB25FD33f2Be45D2771f1EeA4",
109+
"forkID": 6,
110+
"salt": "0x0000000000000000000000000000000000000000000000000000000000000000",
111+
"version": "0.0.1"
112+
}
113+
```
114+
115+
4. In the `~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/` folder, you should also see a `genesis.json` file.
116+
117+
!!! info
118+
We use the info in `genesis.json` and `deploy_output.json` to configure the `cdk-validium-node` node.
119+
120+
!!! warning "Deployment failure"
121+
- Since there are deterministic addresses, you cannot deploy twice on the same network using the same `salt` and `initialCDKValidiumDeployerOwner` inside `deploy_parameters.json`. Changing one of them is enough to make a new deployment.
122+
- It's mandatory to delete the `~/cdk-validium/cdk-validium-contracts-0.0.2/.openzeppelin` upgradability information in order to make a new deployment.
123+
124+
## Verify contracts
125+
126+
When deploying to Sepolia, the contracts should automatically verify based on other live deployments on the network with similar bytecode. If the contracts have not been verified on Etherscan, run the following commands from the `/cdk-validium/cdk-validium-contracts-0.0.2/deployment` directory.
127+
128+
1. To verify the contract factory:
129+
130+
```bash
131+
npm run verify:deployer:CDKValidium:sepolia
132+
```
133+
134+
2. To verify the rest of the contract suite:
135+
136+
```bash
137+
npm run verify:CDKValidium:sepolia
138+
```
139+
140+
## Use a different node provider
141+
142+
If you would rather use a different node provider than Infura, modify the contents of `~/cdk-validium/cdk-validium-contracts-0.0.2/hardhat.config.js` and `cdk-validium-contracts-0.0.2/.env` .
143+
144+
For example, using Alchemy:
145+
146+
```bash
147+
MNEMONIC="island debris exhaust typical clap debate exhaust little verify mean sausage entire"
148+
INFURA_PROJECT_ID="" # or blank if not using Infura
149+
ETHERSCAN_API_KEY="1234567890abcdefghijklmnopqr" # or blank if not verify contracts
150+
ALCHEMY_PROJECT_ID="dGPpsDzM9KpFTEnqMO44rvIXcc0fmgxr" # add this line
151+
```
152+
153+
```bash
154+
sepolia: {
155+
url: `https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_PROJECT_ID}`, # rpc value changed here
156+
accounts: {
157+
mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC,
158+
path: "m/44'/60'/0'/0",
159+
initialIndex: 0,
160+
count: 20,
161+
},
162+
},
163+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Hardware
2+
3+
- A Linux-based OS (e.g., Ubuntu Server 22.04 LTS).
4+
- At least 8GB RAM with a 2-core CPU.
5+
- An AMD64 architecture system.
6+
7+
## Software
8+
9+
Make sure you have the following software:
10+
11+
| Download link | Version | Check version |
12+
| --- | --- | --- |
13+
| [Node](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) | ^20 | `node --version` |
14+
| npm | ^10 | `npm --version` |
15+
| [Foundry](https://book.getfoundry.sh/getting-started/installation) | ^0.2 | `forge --version` |
16+
| [jq](https://jqlang.github.io/jq/download/) | ^1.6 | `jq -V` |
17+
18+
## Sepolia access
19+
20+
You will need the following:
21+
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.
24+
25+
### Faucets
26+
27+
Use a public faucet to get Sepolia test ETH.
28+
29+
- [Infura faucet](https://www.infura.io/faucet/sepolia).
30+
- [Chainstack faucet](https://chainstack.com/sepolia-faucet/).
31+
- [Quicknode faucet](https://faucet.quicknode.com/ethereum/sepoli).
32+
33+
## Configuration files
34+
35+
Create a folder `/tmp/cdk/` to store configuration files.
36+
37+
```bash
38+
mkdir /tmp/cdk/
39+
```
40+
41+
## Environment variables
42+
43+
Create a `.env` file to store environment variables we will use later on.
44+
45+
```bash
46+
nano /tmp/cdk/.env
47+
```
48+
49+
!!! danger
50+
The system removes this file on shutdown.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
## Download the validium repo
2+
3+
1. Create a new directory and cd into it.
4+
5+
```bash
6+
cd ~/
7+
mkdir cdk-validium
8+
cd cdk-validium/
9+
```
10+
11+
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).
12+
13+
!!! note
14+
The download is available in both `.tar.gz` and `.zip` formats.
15+
16+
```bash
17+
curl -L -o cdk-validium-contracts.tar.gz https://github.com/0xPolygon/cdk-validium-contracts/archive/refs/tags/v0.0.2.tar.gz
18+
```
19+
20+
3. Extract the files and cd into the repo.
21+
22+
```bash
23+
tar -xzf cdk-validium-contracts.tar.gz
24+
cd cdk-validium-contracts-0.0.2/
25+
```
26+
27+
## Install the dependencies
28+
29+
```bash
30+
npm install
31+
```
32+
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+
```
40+
41+
2. Generate a new mnemonic using `cast`.
42+
43+
```bash
44+
cast wallet new-mnemonic --words 12
45+
```
46+
47+
!!! tip
48+
If the command `new-mnemonic` is not found, update foundry with `foundryup` and try again.
49+
50+
The output should look something like this:
51+
52+
```bash
53+
Phrase:
54+
island debris exhaust typical clap debate exhaust little verify mean sausage entire
55+
Accounts:
56+
- Account 0:
57+
Address: 0x8Ea797e7f349dA91078B1d833C534D2c392BB7FE
58+
Private key: 0x3b01870a8449ada951f59c0275670bea1fc145954ee7cb1d46f7d21533600726
59+
```
60+
61+
3. Add the environment variables to the `.env` file.
62+
63+
```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/)
67+
ETHERSCAN_API_KEY="<ETHERSCAN_API_KEY>" # Generate an API key on [Etherscan](https://etherscan.io)
68+
```
69+
70+
!!! info
71+
Check our documentation if you want to [use a different node provider](deploy-contracts.md#use-a-different-node-provider).
72+
73+
4. Send 2 Sepolia ETH to the generated address.
74+
75+
5. Add the following variables to `/var/tmp/cdk/.env`.
76+
77+
```bash
78+
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>"
83+
```
84+
!!! important
85+
This step allows us to use `jq` and `tomlq` later on to setup our configuration files.
86+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
This quick start takes you through the process of deploying a full CDK validium, EVM-compatible network on Sepolia.
2+
3+
The process requires two separate flows with different software requirements. For this reason, these instructions have two distinct sections.
4+
5+
1. [Deploying the contracts](contracts/prerequisites.md).
6+
2. [Deploying the node and services](node/prerequisites.md).
7+
8+
!!! warning
9+
- The instructions are subject to frequent updates as the software remains at an early development stage.
10+
- Report any content issues on our docs repo: https://github.com/0xPolygon/polygon-docs
11+
12+
## Git repos
13+
14+
These are code bases we use to set everything up, and in this order.
15+
16+
| Repo | Version |
17+
| --- | --- |
18+
| https://github.com/0xPolygon/cdk-validium-contracts/releases/tag/v0.0.2 | v0.0.2 |
19+
| https://github.com/0xPolygon/cdk-validium-node/releases/tag/v0.0.3 | v0.0.3 |
20+
| https://github.com/0xPolygonHermez/zkevm-prover | v3.0.2 |
21+
| https://github.com/0xPolygon/cdk-data-availability.git | v0.0.3 |
22+
| https://github.com/0xPolygonHermez/zkevm-bridge-service | v0.3.1 |

0 commit comments

Comments
 (0)