Deploy your validator node
In this page, we introduce instructions to deploy your Carmentis validator node.
A replicator node can be launched with a minimal configuration by running only a node. Validator nodes, however, are expected to run both a node and an operator. In theory, we encourage to install a node and an operator in distinct servers to improve security and modularity. In practice, since we are using Docker, both node and operator can be installed on the same server, this configuration is called validator set up. For more convenience, we provide two distinct documentation pages:
- Follow this link to deploy a replicator node
- Follow this link to deploy a validator node
Prerequisites
For validator nodes, we recommend a server with at least 2 cores and 4GB of RAM. The server should be externally accessible with a public IP address and three domain names pointing to your server:
node.your-domain-name
used to handle the node connection.operator.your-domain-name
used to handle the operator operations.workspace.your-domain-name
used to expose the front (user-friendly interface) for the operator.
Set up node configuration
Docker installation
Docker is intensively used in our procedure to install, configure and run components.
Follow the instructions on the official Docker documentation to install Docker.
To check your installation, run docker run --rm hello-world
.
Be careful, old docker versions are using docker-compose
name.
Set up node configuration using CLI
We provide a CLI to set up the configuration quickly.
Step 1: Install npm and the CLI
The first step is to install the node package manager (npm).
sudo apt update && sudo apt upgrade -y && sudo apt install npm && sudo npm i -g @cmts-dev/carmentis-cli
Step 2: Init the CLI
Before to proceed to the generation, you have to initialize the CLI, notably by importing the reference networks:
cmts networks import
You can list the loaded networks using the cmts networks list
command.
Step 3: Generate the config
To generate the configuration of your node, execute the following command and answer to the response interactively
(replace the $PATH_TO_GENERATE_CONFIG
with the path where the configuration is generated):
cmts validator init-config --home $PATH_TO_GENERATE_CONFIG
Step 4: Run the node
To run the node, execute the following command (replace the $PATH_TO_GENERATE_CONFIG
with the path where the configuration has been generated):
cd $PATH_TO_GENERATE_CONFIG && docker compose up -d
Launch the node
By running the following command, the node will be launched.
docker compose up -d
Next steps
Checking node status
To check if the node status is alive, you can proceed to the domain name associated where the node is deployed.
A list of endpoints should be displayed. Check one of our nodes, for example, at https://ares.testnet.carmentis.io.
Then, click on the status
endpoint to check the node status and search for the is_catching_up
and latest_block_height
fields.
If the value of is_catching_up
is true
, the node is still catching up with the blockchain.
If the value is false
and latest_block_height
is defined, the node is up, synchronized and running.
Access to the logs
To check the logs of the node, you can use docker using the docker compose logs -f
command.
Stop the node
To stop the node, run the following command:
docker compose down
Reset the node from scratch
To reset the node from scratch (like a fresh node), you can use the following command:
# down the ABCI and CometBFT containers
docker compose down node-abci node-cometbft
# clear the local data (be careful, this command will delete all the data, requiring a new synchronization)
cometbft unsafe-reset-all --home ./cometbft && rm -Rf abci
# restart the node
docker compose up -d
Update the CLI
To keep your CLI up-to-date, execute the following method:
npm update -g @cmts-dev/carmentis-cli
Security considerations
Based on the CometBFT documentation, for security reasons, the port (26658 by default) of the ABCI server handling CometBFT requests SHOULD NEVER be exposed (except for the CometBFT server).
Troubleshooting
The sudo
command is not found
The sudo
command does not exist when logged as root.
Either log in as a regular user to execute the commands or adapt the command by removing the sudo
.
The curl
and/or jq
commands are not found
Ensure that you have installed curl
and jq
on your system using the following command:
sudo apt install curl jq
Operator requests end in 404
In development, if the request ends in 404, ensure that the operator listens at the right port by checking the logs. Indeed, when starting the operator, if the specified port is not available, the operator attempts to listen on another free port.
The workspace shows an operator connection error
When the workspace cannot establish a connection with the operator, it displays an error message. The problem might come from several issues:
- The operator server is not running.
- The operator server does not listen to the correct port. It might come from an invalid port specification in the configuration, from a port conflict (the operator tries another free port), or an invalid docker port mapping.
- The
Caddyfile
is invalid if you have provided twice the same URL for the two servers or an invalid URL. - The DNS configuration is not updated. You might have to update the DNS configuration to point to the correct IP address.
Docker not permitted
In a fresh install of Docker, you might be unable to execute the docker run hello-world
command.
To solve this issue, we highly recommend you to follow the official Docker documentation for post-installations.
For more convinience, you can run the following commands but remember to check the official Docker documentation:
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
docker run --rm hello-world
The docker-compose
command is not found
Have you tried docker compose
?