Running a Validator or RPC Node
Running a Validator
Running a RPC Node
This guide will instruct you how to set up a CLV validator node on CLV networks (Testnet/Sakura/Mainnet).

​
πŸ‘‰
Must Read Before Start....

Running a validator is a serious thing, you have a lot responsibility for the staked tokens of you and nominators. You take the risk of losing your staked tokens as a slash might happen if your validator node is not properly configured. Please make sure you or your team have the necessary knowledge to run a validator node.
​Polkadot Wiki has an awesome introduction of running a validator node on the Polkadot network. As a member of the Polkadot ecosystem, CLV follows the similar process to run and setup a validator node. We may skip some basics steps in this tutorial.

​
πŸ› 
Hardware Requirements

  • CPU - Recent released high end cpu, e.g. Intel Core i7-10700/AMD Ryzen 7 5800X or above
  • Memory - 32GB for Testnet, 64GB for Sakura and Mainnet.
  • Storage - 300GB SSD, Storage usage could increase by time, you might need to increase the capacity as the chain data grows..
  • OS: Linux, Debian/Ubuntu LTS distributions are recommended.

​
πŸ”§
Prepare Environment

We'll use docker and docker-compose to run the validator in this guide. You need to install docker and docker-compose firstly. Please follow the installation guide in the docs.
We're using docker to simplify the setup process. You can use the tools which you're familiar with.

​
πŸ›°
Firewall Setup

Below ports need to be exposed:
  • 30333 - The p2p port of the chain

​
πŸ“
Create Directories

Create the config and data directories using below command:
1
sudo mkdir -p /opt/data/
2
sudo mkdir -p /opt/compose/
3
# secure the data access
4
sudo chmod 0700 /opt/data
5
sudo chmod 0700 /opt/compose
Copied!

​
βš™
Setup CLV Validator Node

Currently we only have CLV Testnet(iris) and CLV Mainnet(ivy) launched. CLV Testnet opens for validators to join. CLV Mainnet operates in the POA mode and maintained by 6 nodes belongs to CLV foundation.
Validator Configuration for CLV Mainnet will be updated later once it's ready for staking and validators can join.

​
πŸ“
Create the Compose configure file

Create /opt/compose/docker-compose.yaml and set the content as below:
1
version: "3.8"
2
services:
3
clover-validator:
4
image: "cloverio/clover-ivy:0.1.20"
5
restart: always
6
command:
7
- /opt/clover/bin/clover
8
- --chain
9
- /opt/specs/clover-ivy.json
10
- --base-path
11
- /opt/chaindata
12
- --validator
13
- --name
14
- πŸ€clover-validatornode
15
- --port
16
- "30333"
17
- --ws-port
18
- "9944"
19
- --rpc-port
20
- "9933"
21
- --rpc-cors=all
22
- --execution
23
- wasm
24
ports:
25
- "30333:30333"
26
- "9933:9933"
27
- "9944:9944"
28
volumes:
29
- /opt/data/clover:/opt/chaindata
Copied!
You can edit the docker-compose.yaml and include your customizations by updating below arguments:
  • image: the docker image used to launch the node, for CLV mainnet, use cloverio/clover-ivy:0.1.16.For a full list of clover networks please check out the CLV Network List page.
  • --name: The node name of your validator, the name could be found in the telemetry node list.
  • --unsafe-rpc-external: You might need this flag to call the author_rotateKeys api, make sure to remove this flag later on for better security.
  • Ensure enable the --exeuction wasm flag, This is required for all validator nodes.

​
πŸš€
Bring up the validator node

Use below command to bring up the validator node:
1
cd /opt/compose # goto the compose file directory
2
docker-compose up # bring up the validator node in the foreground
3
## check whether the node starts up normally
4
## Ctrl-C stop the node
5
docker-compose up -d # start the validator node in the daemon mode.
Copied!
You need to check the node logs using docker-compose logs command. Wait until the node is synced and the block numbers syncs with the latest number on the chain.

​
πŸ’Ή
Bond CLV

Checkout Staking documentation.

​
πŸ—
Set the session keys

Checkout Polkadot Session Keys documentation.

​
🌠
Validate

Checkout Polkadot Validate documentation.

​
πŸ”±
Links

CLV Foundation provides the RPC services for the public. Sometimes it's necessary to run a self hosted CLV RPC service if the public services can't satisfy your needs.
With a self hosted CLV RPC service you could gain below benefits:
  • Faster access speed - a Self-hosted RPC node could provide better performance
  • Better security - transactions could be sent to to the self-hosted RPC server instead of the public service.
  • Better Availability
CLV is a fully decentralized network, anyone can setup a CLV node by following this tutorial!

πŸ€
Types Of CLV RPC Nodes

Generally speaking, there are two kind of RPC nodes:
  • Archive node An archive node keeps all the past blocks data. And client can't query data in any of the past blocks.
  • Full node A full is node is pruned. which means it keeps only a few of the past blocks data (256 by default, which could be adjusted using the --pruning command line arguments.
An archive nodes consumes much more disk spaces it stores more data than a full node. You need to take the decision based on your business model and requirements. E.g. block explorer and historical analysis tools normally requires an archive node to query the full historical data. Wallets on the other hand normally only requires a full node to be able to query the current state(e.g. the balance of an account) and submit transactions to the CLV Network.

​
πŸ› 
Hardware requirements

  • CPU - Recent released high end cpu, e.g. Intel Core i7-10700/AMD Ryzen 7 5800X or above
  • Memory - 32GB for Testnet, 64GB for Sakura and Mainnet.
  • Storage - 300GB SSD, Storage usage could increase by time, you might need to increase the capacity as the chain data grows..
  • OS: Linux, Debian/Ubuntu LTS distributions are recommended.

Prepare Environment

We'll use docker and docker-compose to run the validator in this guide. You need to install docker and docker-compose firstly. Please follow the installation guide in the docs.
We're using docker to simplify the setup process. You can use the tools which you're familiar with.

​
πŸ›°
Firewall Setup

Below ports need to be exposed:
  • 30333 - The p2p port of the chain
  • 9933 - The http endpoint of the RPC service
  • 9944 - The websocket endpoint of the RPC service.
You may not expose 9933/9944 ports directly. Instead a reverse proxy server could be setup in front and proxy requests to the rpc backend.
​

​
πŸ“
Create Directories

Create the config and data directories using below command:
1
sudo mkdir -p /opt/data/
2
sudo mkdir -p /opt/compose/
3
# secure the data access
4
sudo chmod 0700 /opt/data
5
sudo chmod 0700 /opt/compose
Copied!

​
βš™
Setup CLV RPC Node

Currently we only have CLV Testnet(iris) and CLV Mainnet(ivy) launched.
Rpc Configuration for CLV Mainnet will be updated later.

​
πŸ“
Create the Compose configure file

Create /opt/compose/docker-compose.yaml and set the content as below:
1
version: "3.8"
2
services:
3
clover-validator:
4
image: "cloverio/clover-iris:0.1.15"
5
restart: always
6
command:
7
- /opt/clover/bin/clover
8
- --chain
9
- /opt/specs/clover-preview-iris.json
10
- --base-path
11
- /opt/chaindata
12
- --pruning
13
- archive
14
- --name
15
- πŸ€clover-rpc-node
16
- --port
17
- "30333"
18
- --ws-port
19
- "9944"
20
- --rpc-port
21
- "9933"
22
- --rpc-cors=all
23
- --ws-max-connections
24
- "2000"
25
- --ws-external
26
- --rpc-external
27
- --execution
28
- wasm
29
ports:
30
- "30333:30333"
31
- "9933:9933"
32
- "9944:9944"
33
volumes:
34
- /opt/data/clover:/opt/chaindata
Copied!
You can edit the docker-compose.yaml and include your customizations by updating below arguments:
  • image: the docker image used to launch the node, for CLV Testnet, use cloverio/clover-iris:0.1.15. For a full list of clover networks please check out the Clover Network List page.
  • --name: The node name of your validator, the name could be found in the telemetry node list
  • --pruning: we're using the archive mode for the pruning argument, which means it will keep all the historical block data. You can provide numeric parameters for it, to let it just keep the provided number of blocks data.
  • --ws-extenral/--rpc-external: it enable the outer access for the RPC service.
  • Enabling --execution wasm will spped up wasm code execution quite a lot, it's recommended for rpc nodes.

​
πŸš€
Bring up the RPC node

Use below command to bring up the validator node:
1
cd /opt/compose # goto the compose file directory
2
docker-compose up # bring up the rpc node in the foreground
3
## check whether the node starts up normally
4
## Ctrl-C stop the node
5
docker-compose up -d # start the rpc node in the daemon mode.
Copied!
You need to check the node logs using docker-compose logs command. Wait until the node is synced and the block numbers syncs with the latest number on the chain.

​
πŸ“‘
Post Setup

You may want to setup a reverse proxy server or load balancer for the RPC service. There're some known tools for you to start with, please checkout:
  • ​Nginx - High Performance Load Balancer, Web Server, & Reverse Proxy
  • ​Caddy - Powerful, enterprise-ready, open source web server with automatic HTTPS written in Go

Docker Compose file templates

Below are several docker compose file templates for ClV networks.
CLV Mainnet (M-Chain)
CLV ParaChain (P-Chain)
1
version: "3.8"
2
services:
3
clover-rpc:
4
image: 'cloverio/clover-ivy:0.1.20'
5
restart: always
6
environment:
7
ARGS: "--base-path /opt/chaindata --chain /opt/specs/clover-ivy.json --port 30333 --ws-port 9944 --rpc-port 9933 --pruning archive --name ivy-a-rpc4 --rpc-cors=all --ws-max-connections 5000 --ws-external --rpc-external"
8
ports:
9
- "9933:9933"
10
- "9944:9944"
11
- "30333:30333"
12
- "9615:9615"
13
volumes:
14
- /opt/data/chains/ivy:/opt/chaindata
15
- /opt/data/config:/opt/config
Copied!
1
version: "3.3"
2
services:
3
clover-para-node:
4
image: "cloverio/clover-para:polkadot-v0.9.16.1"
5
restart: always
6
command:
7
- /opt/clover/bin/clover
8
- --parachain-id
9
- "2002"
10
- --chain
11
- /opt/specs/clover-para-raw.json
12
- --base-path
13
- /opt/chaindata
14
- --name
15
- clover-para-rpc
16
- --bootnodes
17
- /dns/boot1.para.clover.finance/tcp/40335/ws/p2p/12D3KooWFWYYwimRBexvZokZmNnmSdXcLCz8WmMTHDCAhzm5tLM6
18
- /dns/boot2.para.clover.finance/tcp/40335/ws/p2p/12D3KooWSvvxYi9nkyGJ17hEjwmytNRMrSsQtSrGsHzUaLTcUUea
19
- --pruning # you can remove the pruning parameter if you don't need a full archive node
20
- archive #
21
- --ws-port
22
- "9946"
23
- --rpc-port
24
- "20194"
25
- --port
26
- "40335"
27
- "--rpc-cors=all"
28
- --rpc-external
29
- --ws-external
30
- --execution
31
- wasm
32
- --ws-max-connections
33
- "5000"
34
- --
35
- --execution
36
- wasm
37
- --ws-port
38
- "10194"
39
- --rpc-port
40
- "10195"
41
- --chain
42
- polkadot
43
- --port
44
- "30335"
45
ports:
46
- "9946:9946"
47
- "20194:20194"
48
- "40335:40335"
49
- "30335:30335"
50
volumes:
51
- /data/data/chains/bootnode:/opt/chaindata
52
- /data/data/config:/opt/config
53
logging:
54
driver: "json-file"
55
options:
56
max-size: "25m"
57
max-file: "2"
58
​
Copied!