Skip to content

Commit 2a37719

Browse files
deploy node set up instructions
1 parent 75ae2e4 commit 2a37719

File tree

2 files changed

+61
-56
lines changed

2 files changed

+61
-56
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| `make` | 3.80.0 | https://www.gnu.org/software/make/ |
2222
| `docker` | 24.0.0 | https://docs.docker.com/engine/install/ |
2323
| `pip3` | 20.0.0 | https://pip.pypa.io/en/stable/installation/ |
24-
| `python3` | 3.8.0 | https://www.python.org/downloads/ |
24+
| [For testing] `python3` | 3.8.0 | https://www.python.org/downloads/ |
2525
| [For testing] `polycli` | 0.1.39 | https://github.com/maticnetwork/polygon-cli/tree/main |
2626

2727
1. Create a `version-check.sh` file and copy and paste the script below.

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

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -28,87 +28,92 @@
2828
cd ~/cdk-validium
2929
```
3030

31-
## 1. Downloading cdk-validium-node, cdk-data-availability, and cdk-bridge-service
31+
## Download `cdk-validium-node`, `cdk-data-availability`, and `cdk-bridge-service`
3232

33-
Now clone the `0.0.3` release of `cdk-validium-node`.
33+
1. Clone the `0.0.3` release of `cdk-validium-node`.
3434

35-
```bash
36-
git clone --depth 1 --branch v0.0.3 https://github.com/0xPolygon/cdk-validium-node.git
37-
```
35+
```bash
36+
git clone --depth 1 --branch v0.0.3 https://github.com/0xPolygon/cdk-validium-node.git
37+
```
3838

39-
We also must download and extract version `0.0.3` of `cdk-data-availability.` The release file is available here:
39+
2. Download and extract version `0.0.3` of `cdk-data-availability` as a tar.gz file.
4040

41-
[Untitled Database](https://www.notion.so/b329e3b1511943ae979cc2b4c73a35e8?pvs=21)
41+
!!! info
42+
The release file is available here: [Untitled Database](https://www.notion.so/b329e3b1511943ae979cc2b4c73a35e8?pvs=21)
4243

43-
Downloading `cdk-validium-contracts` as a ***`tar.gz`*** and extracting
44+
```bash
45+
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+
```
4448

45-
```bash
46-
~/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
47-
\tar -xzf cdk-data-availability.tar.gz
48-
```
49+
3. Finally, download the `cdk-bridge-service` release `0.3.1`. The release file can be found here:
4950

50-
Finally, the `cdk-bridge-service` release `0.3.1`. The release file can be found here:
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+
```
5155

52-
```bash
53-
curl -L -o cdk-bridge-service.tar.gz https://github.com/0xPolygonHermez/zkevm-bridge-service/archive/refs/tags/v0.3.1.tar.gz
54-
\tar -xzf cdk-bridge-service.tar.gz
56+
You should see three new directories in `cdk-validium/`:
5557

56-
```
57-
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`***
58+
- `cdk-data-availability-0.0.3`
59+
- `cdk-validium-node`
60+
- `zkevm-bridge-service-0.3.1`
5861

59-
## 2. Preparing the environment
62+
## Prepare the environment
6063

61-
We will begin our setup in the node directory.
64+
Navigate to the node directory we cloned at the previous step: `cdk-validium-node/`.
6265

63-
Navigate into the node directory we cloned from the previous step***`cdk-validium-node/`***
66+
```bash
67+
cd cdk-validium-node/
68+
```
6469

65-
```bash
66-
~/cdk-validium % cd cdk-validium-node/
67-
```
70+
## Set up the database
6871

69-
### Setup the database
72+
1. Run the docker command below 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.
7073

71-
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.
74+
```bash
75+
docker run -e POSTGRES_USER=cdk_user -e POSTGRES_PASSWORD=cdk_password -e POSTGRES_DB=postgres -p 5432:5432 postgres:15
76+
```
7277

73-
```bash
74-
docker run -e POSTGRES_USER=cdk_user -e POSTGRES_PASSWORD=cdk_password -e POSTGRES_DB=postgres -p 5432:5432 postgres:15
75-
```
78+
!!! note "Port is in use"
79+
If you are unable to start the process because a port is in use, check the processes occupying the port then kill those processes.
7680

77-
*note: if you are unable to start the process because port is in use, check the processes occupying the port then kill the processes*
81+
```bash
82+
sudo lsof -t -i:5432
83+
kill -9 <PID>
84+
```
7885

79-
```bash
80-
sudo lsof -t -i:5432
81-
kill -9 <PID>
82-
```
86+
2. Use the following command to validate the setup (`\q` to exit).
8387

84-
Once you have postgres running, validate you have the following setup correctly:
88+
```bash
89+
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432
90+
#=> \q
91+
```
8592

86-
- an admin account called: `cdk_user` with a password of `cdk_password`
87-
- postgres server running on `localhost:5432`
93+
You should have:
8894

89-
You can use the following command to validate the steps, `\q` to exit:
95+
- An admin account called: `cdk_user` with a password of `cdk_password`.
96+
- A postgres server running on `localhost:5432`.
9097

91-
```bash
92-
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432
93-
#=> \q
94-
```
98+
## Provision the database
9599

96-
### Provision the database
100+
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.
97101

98-
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:
102+
1. Run the script to provision all the necessary databases and schemas used for the prover and node:
99103

100-
```bash
101-
~/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
102-
```
104+
```bash
105+
cd /cdk-validium/cdk-validium-node
106+
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -a -q -f ./db/scripts/single_db_server.sql
107+
```
103108

104-
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.
109+
2. In addition to the provisions required for the Data Availability Committee (DAC). We can set this up now to use later.
105110

106-
```bash
107-
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -c "CREATE DATABASE committee_db;"
108-
```
111+
```bash
112+
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -c "CREATE DATABASE committee_db;"
113+
```
109114

110-
Finally, we will provision a database for our bridge service, which we will setup last in this guide.
115+
3. Finally, provision a database for the bridge service.
111116

112-
```bash
113-
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -c "CREATE DATABASE bridge_db;"
114-
```
117+
```bash
118+
PGPASSWORD=cdk_password psql -h localhost -U cdk_user -d postgres -p 5432 -c "CREATE DATABASE bridge_db;"
119+
```

0 commit comments

Comments
 (0)