Run a validator node on Docker#
This guide describes how to set up the node to run as a validator node on a Docker/Linux node that participates in the Concordium network. A node receives blocks and transactions from other nodes and propagates information about blocks and transactions to the nodes in the Concordium network. In addition, a validator node also participates in the lottery and produces its own blocks.
Configure a node as a validator#
Once you have generated validator keys, you then need to move the generated validator keys file to a location accessible by the node, and finally specify this location in the service file for the Concordium Node.
To register the keys in the network you need to be running a node and send a
validator add transaction to the network:
$concordium-client validator add <keys-file>.json --sender validatorAccount --stake <amount-to-stake> --out <concordium-data-dir>/validator-credentials.json
where you replace
<amount-to-stake>with the CCD amount for the validators’s initial stake
<concordium-data-dir>with the directory specified as the volume mount for the node database. In the sample configuration file this is
/var/lib/concordium-testnetfor the testnet node, and
/var/lib/concordium-mainnetfor the mainnet node.
Do not stake all of your funds or you will not have enough funds to cover transaction fees.
--no-restake flag to avoid automatically adding the rewards to the staked amount on the validator account. Read more about this behavior in the section Restake earnings.
To start the node with these validator keys and produce blocks, do the following:
Stop the currently running node. To do this, press
Ctrl + Con the terminal where the node is running or run
$docker stop testnet-node
$docker stop mainnet-node
depending on the environment.
Update the configuration file for the node by adding
environmentsection of the
nodeservice section of the file.
When you’ve placed the file in the appropriate directory, start the node again in the same way as the first time, e.g.,
docker-compose -f testnet-node.yaml
up. The node will automatically start producing blocks when the validator is included in the validators for the current epoch.
In the wallets, a badge is added to the account associated with the validator node. The badge appears as soon as the transaction has been submitted. That is, before the two epochs have elapsed.