Klever Finance
Search…
How to run a node
Commands to run a node
Klever nodes run inside a docker container, check System Requirements section to download Klever Toolchain first.

Create statics directory

Create a folder where all the data will be stored:
1
mkdir -p $(pwd)/node/config $(pwd)/node/db $(pwd)/node/logs
Copied!

Network genesis config

Download latest config file (http://) and extract into your config directory
1
curl -k https://backup.testnet.klever.finance/config.testnet.100420.tar.gz \
2
| tar -xz -C ./node
Copied!

Create your validator BLS Key

Execute a command inside the docker container to create wallets for validators. The data is then forwarded to the directory created previously.
1
docker run -it --rm -v $(pwd)/node/config:/opt/klever-blockchain \
2
--user "$(id -u):$(id -g)" \
3
--entrypoint='' kleverapp/klever-go-testnet:latest keygenerator
Copied!

Download and extract data backup for fast spin

Download a backup in case it exists. Every time the network is reset, files change as well. So, this backup is necessary.
1
curl -k https://backup.testnet.klever.finance/kleverchain.latest.tar.gz \
2
| tar -xz -C ./node
Copied!

Run your node

The command for running a node comes with a few settings: it includes mappings for cryptographic keys, data directories and logs, as well as network ports, the application that will run when the docker image is executed and the file of node validators signature.
1
docker run -it --rm \
2
--user "$(id -u):$(id -g)" \
3
--name klever-node \
4
-v $(pwd)/node/config:/opt/klever-blockchain/config/node \
5
-v $(pwd)/node/db:/opt/klever-blockchain/db \
6
-v $(pwd)/node/logs:/opt/klever-blockchain/logs \
7
--network=host \
8
--entrypoint=/usr/local/bin/validator \
9
kleverapp/klever-go-testnet:latest \
10
'--log-save' '--rest-api-interface=0.0.0.0:8080'
Copied!
The table below shows what each part of the command is supposed to do.
Command
Function
-v $(pwd)/config:/opt/klever-blockchain/config/node
Import genesis config and the generated .pem file (BLS Key).
-v $(pwd)/node/db:/opt/klever-blockchain/db
Select the destination DB folder.
-v $(pwd)/klv/logs:/opt/klever-blockchain/logs
Save log files and set the log folders
If one wants to monitor the node using log files, the flag --use-log-view must be passed. Otherwise, the standard view is a visual interface as seen below.
When you are done setting up and running your node, you are expected to see information about your node, the blockchain itself, as well as data from your own computer, just like the example below:
A node running, showing how many blocks were proposed and accepted, current blocks, slots and connected nodes, last generated hash, computational information, epoch and network processes and a basic log info segment.

Run node in the background

When running in the background, add parameter --use-log-view and replace --rm for -d
1
docker run -it -d --restart unless-stopped \
2
--user "$(id -u):$(id -g)" \
3
--name klever-node \
4
-v $(pwd)/node/config:/opt/klever-blockchain/config/node \
5
-v $(pwd)/node/db:/opt/klever-blockchain/db \
6
-v $(pwd)/node/logs:/opt/klever-blockchain/logs \
7
--network=host \
8
--entrypoint=/usr/local/bin/validator \
9
kleverapp/klever-go-testnet:latest \
10
'--log-save' '--use-log-view' '--rest-api-interface=0.0.0.0:8080'
Copied!
If you are running your node in the background, you can either verify logs in ./node/logs folder or use the docker command:
1
docker logs -f --tail 5 klever-node
Copied!
Copy link
Contents