Skip to content

Commit bfe4a98

Browse files
update latest
1 parent 511beda commit bfe4a98

File tree

5 files changed

+27
-134
lines changed

5 files changed

+27
-134
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ When deploying to Sepolia, the contracts should automatically verify based on ot
141141
142142
## Use a different node provider
143143
144-
Modify the contents of `~/cdk-validium/cdk-validium-contracts-0.0.2/hardhat.config.js` and `cdk-validium-contracts-0.0.2/.env` if you prefer to use a different node provider than Infura.
144+
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` .
145145
146146
For example, using Alchemy:
147147

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ mkdir /tmp/cdk/
4343
Create a `.env` file to store environment variables we will use later on.
4444

4545
```bash
46-
nano /tmp/cdk/.env
46+
nano /var/tmp/.env
4747
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ npm install
7373

7474
5. Send 2 Sepolia ETH to the generated address.
7575

76-
6. Add the following variables to `/tmp/cdk/.env`.
76+
6. Add the following variables to `/var/tmp/.env`.
7777

7878
```bash
7979
# /tmp/cdk/.env

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

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,5 @@
11

22

3-
# Setup & Deployment
4-
5-
First, lets navigate back to the working directory we created earlier, `~/cdk-validium`
6-
7-
```bash
8-
cd ~/cdk-validium
9-
```
10-
11-
For this setup, we will also need our information from `deploy_output.json` inside `~/cdk-validium/cdk-validium-contracts-0.0.2/deployment`. Navigate back to `~/cdk-validium/cdk-validium-contracts-0.0.2/deployment` and run the following script to fill the required parameters into the `/tmp/cdk/.env` we created in the previous steps:
12-
13-
```bash
14-
cd ~/cdk-validium/cdk-validium-contracts-0.0.2/deployment
15-
echo "GEN_BLOCK_NUMBER=$(jq -r '.deploymentBlockNumber' deploy_output.json)" >> /tmp/cdk/.env
16-
echo "CDK_VALIDIUM_ADDRESS=$(jq -r '.cdkValidiumAddress' deploy_output.json)" >> /tmp/cdk/.env
17-
echo "POLYGON_ZKEVM_BRIDGE_ADDRESS=$(jq -r '.polygonZkEVMBridgeAddress' deploy_output.json)" >> /tmp/cdk/.env
18-
echo "POLYGON_ZKEVM_GLOBAL_EXIT_ROOT_ADDRESS=$(jq -r '.polygonZkEVMGlobalExitRootAddress' deploy_output.json)" >> /tmp/cdk/.env
19-
echo "CDK_DATA_COMMITTEE_CONTRACT_ADDRESS=$(jq -r '.cdkDataCommitteeContract' deploy_output.json)" >> /tmp/cdk/.env
20-
echo "MATIC_TOKEN_ADDRESS=$(jq -r '.maticTokenAddress' deploy_output.json)" >> /tmp/cdk/.env
21-
```
22-
23-
Source our new environment and navigate back to `~/cdk-validium`:
24-
25-
```bash
26-
source /tmp/cdk/.env
27-
cd ~/cdk-validium
28-
```
29-
30-
## 1. Downloading cdk-validium-node, cdk-data-availability, and cdk-bridge-service
31-
32-
Now clone the `0.0.3` release of `cdk-validium-node`.
33-
34-
```bash
35-
git clone --depth 1 --branch v0.0.3 https://github.com/0xPolygon/cdk-validium-node.git
36-
```
37-
38-
We also must download and extract version `0.0.3` of `cdk-data-availability.` The release file is available here:
39-
40-
[Untitled Database](https://www.notion.so/b329e3b1511943ae979cc2b4c73a35e8?pvs=21)
41-
42-
Downloading `cdk-validium-contracts` as a ***`tar.gz`*** and extracting
43-
44-
```bash
45-
~/cdk-validium % curl -L -o cdk-data-availability.tar.gz https://github.com/0xPolygon/cdk-data-availability/archive/refs/tags/v0.0.3.tar.gz
46-
\tar -xzf cdk-data-availability.tar.gz
47-
```
48-
49-
Finally, the `cdk-bridge-service` release `0.3.1`. The release file can be found here:
50-
51-
```bash
52-
curl -L -o cdk-bridge-service.tar.gz https://github.com/0xPolygonHermez/zkevm-bridge-service/archive/refs/tags/v0.3.1.tar.gz
53-
\tar -xzf cdk-bridge-service.tar.gz
54-
55-
```
56-
Now we have three new directories in *`cdk-validium/`* named ***`cdk-data-availability-0.0.3`, `cdk-validium-node` and `zkevm-bridge-service-0.3.1`***
57-
58-
## 2. Preparing the environment
59-
60-
We will begin our setup in the node directory.
61-
62-
Navigate into the node directory we cloned from the previous step***`cdk-validium-node/`***
63-
64-
```bash
65-
~/cdk-validium % cd cdk-validium-node/
66-
```
67-
68-
### Setup the database
69-
70-
Run the docker command to start an instance of the `psql` database. The database is used for many of the services, such as the node, prover, DAC, and bridge service.
71-
72-
```bash
73-
docker run -e POSTGRES_USER=cdk_user -e POSTGRES_PASSWORD=cdk_password -e POSTGRES_DB=postgres -p 5432:5432 postgres:15
74-
```
75-
76-
*note: if you are unable to start the process because port is in use, check the processes occupying the port then kill the processes*
77-
78-
```bash
79-
sudo lsof -t -i:5432
80-
kill -9 <PID>
81-
```
82-
83-
Once you have postgres running, validate you have the following setup correctly:
84-
85-
- an admin account called: `cdk_user` with a password of `cdk_password`
86-
- postgres server running on `localhost:5432`
87-
88-
You can use the following command to validate the steps, `\q` to exit:
89-
90-
```bash
91-
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432
92-
#=> \q
93-
```
94-
95-
### Provision the database
96-
97-
The `cdk-validium-node` directory contains a script called `single_db_server.sql` that provisions all the databases required for the prover, state, and pool to operate. Run the script to provision all the necessary databases and schemas that will be used for both the prover and node:
98-
99-
```bash
100-
~/cdk-validium/cdk-validium-node % PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -a -q -f ./db/scripts/single_db_server.sql
101-
```
102-
103-
In addition to the provisions required for the prover and node, another provision is needed for the Data Availability Committee (DAC). We can set this up now for use later.
104-
105-
```bash
106-
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -c "CREATE DATABASE committee_db;"
107-
```
108-
109-
Finally, we will provision a database for our bridge service, which we will setup last in this guide.
110-
111-
```bash
112-
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -c "CREATE DATABASE bridge_db;"
113-
```
114-
1153
### Configure the prover
1164

1175
To configure our prover, lets copy and modify the contents of `test.prover.config.json` inside `~/cdk-validium/cdk-validium-node/test/config/` to our `/tmp/cdk/` directory we created earlier using the following jq command:

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

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
1. Navigate back to the working directory we created earlier, `~/cdk-validium`
1+
## Set up the environment variables
22

3-
```bash
4-
cd ~/cdk-validium
5-
```
3+
1. Navigate to `~/cdk-validium`.
64

7-
For this setup, we will also need our information from `deploy_output.json` inside `~/cdk-validium/cdk-validium-contracts-0.0.2/deployment`. Navigate back to `~/cdk-validium/cdk-validium-contracts-0.0.2/deployment` and run the following script to fill the required parameters into the `/tmp/cdk/.env` we created in the previous steps:
5+
```bash
6+
cd cdk-validium
7+
```
88

9-
```bash
10-
cd ~/cdk-validium/cdk-validium-contracts-0.0.2/deployment
11-
echo "GEN_BLOCK_NUMBER=$(jq -r '.deploymentBlockNumber' deploy_output.json)" >> /tmp/cdk/.env
12-
echo "CDK_VALIDIUM_ADDRESS=$(jq -r '.cdkValidiumAddress' deploy_output.json)" >> /tmp/cdk/.env
13-
echo "POLYGON_ZKEVM_BRIDGE_ADDRESS=$(jq -r '.polygonZkEVMBridgeAddress' deploy_output.json)" >> /tmp/cdk/.env
14-
echo "POLYGON_ZKEVM_GLOBAL_EXIT_ROOT_ADDRESS=$(jq -r '.polygonZkEVMGlobalExitRootAddress' deploy_output.json)" >> /tmp/cdk/.env
15-
echo "CDK_DATA_COMMITTEE_CONTRACT_ADDRESS=$(jq -r '.cdkDataCommitteeContract' deploy_output.json)" >> /tmp/cdk/.env
16-
echo "MATIC_TOKEN_ADDRESS=$(jq -r '.maticTokenAddress' deploy_output.json)" >> /tmp/cdk/.env
17-
```
9+
!!! info
10+
For the setup, we need the information from the `~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/deploy_output.json` file.
1811

19-
Source our new environment and navigate back to `~/cdk-validium`:
12+
2. Navigate to `cdk-validium-contracts-0.0.2/deployment` and run the following script that inputs the required parameters into `/tmp/cdk/.env`.
2013

21-
```bash
22-
source /tmp/cdk/.env
23-
cd ~/cdk-validium
24-
```
14+
```bash
15+
cd cdk-validium-contracts-0.0.2/deployment
16+
echo "GEN_BLOCK_NUMBER=$(jq -r '.deploymentBlockNumber' deploy_output.json)" >> /tmp/cdk/.env
17+
echo "CDK_VALIDIUM_ADDRESS=$(jq -r '.cdkValidiumAddress' deploy_output.json)" >> /tmp/cdk/.env
18+
echo "POLYGON_ZKEVM_BRIDGE_ADDRESS=$(jq -r '.polygonZkEVMBridgeAddress' deploy_output.json)" >> /tmp/cdk/.env
19+
echo "POLYGON_ZKEVM_GLOBAL_EXIT_ROOT_ADDRESS=$(jq -r '.polygonZkEVMGlobalExitRootAddress' deploy_output.json)" >> /tmp/cdk/.env
20+
echo "CDK_DATA_COMMITTEE_CONTRACT_ADDRESS=$(jq -r '.cdkDataCommitteeContract' deploy_output.json)" >> /tmp/cdk/.env
21+
echo "MATIC_TOKEN_ADDRESS=$(jq -r '.maticTokenAddress' deploy_output.json)" >> /tmp/cdk/.env
22+
```
23+
24+
3. Save the new environment and navigate back to `~/cdk-validium`.
25+
26+
```bash
27+
source /tmp/cdk/.env
28+
cd ~/cdk-validium
29+
```
2530

2631
## 1. Downloading cdk-validium-node, cdk-data-availability, and cdk-bridge-service
2732

0 commit comments

Comments
 (0)