Import validator keys#

At a glance

Import validator keys into a running Concordium node. You need a node using the supported Docker image and a set of generated validator keys. After configuration, the node can validate when the network includes it in the validators for the current epoch.

A validator node receives and propagates blocks and transactions and produces blocks when selected. See Block production and validation for validation requirements. Credentials registered on mainnet do not work with a testnet node, or vice versa.

Prerequisites#

These instructions use the setup in Install and manage a node. If your paths or service names differ, adjust the examples to match.

Warning

Never run two nodes with the same validator credentials simultaneously. For an existing native or network-specific Docker validator, follow Migrate from old distribution. Reuse its credentials and registration; do not register an existing validator again during migration.

Register a new validator#

If you already registered the keys with a wallet or Concordium Client, skip this step. Use the exported validator-credentials.json file.

To register new keys with Concordium Client, send a validator add transaction from a running node:

$concordium-client validator add <keys-file>.json --sender validatorAccount --stake <amount-to-stake> --validator-credentials-out ./validator-credentials.json

Replace <keys-file>.json with your generated keys file. Replace validatorAccount with your validator account. Replace <amount-to-stake> with the initial stake in CCD. The command writes credentials to ./validator-credentials.json.

Warning

Keep enough CCD to pay transaction fees. Do not stake all your funds. Do not give all users read access to credentials. Do not put credentials in a repository.

To disable automatic restaking, add --no-restake to the command. See Restake the earnings.

Configure the node#

Run these commands in the network directory containing compose.yaml. Use mainnet-node/ or testnet-node/ from the installation guide. Put the exported credentials file in this directory. The steps below copy it into the existing data/ mount.

  1. Stop the node:

    $docker compose stop
    

    Read the last 100 log lines to check for a clean shutdown:

    $docker compose logs --tail 100 node
    

    Confirm a clean shutdown before continuing.

  2. Copy the credentials into the existing data/ directory. Give the container’s UID 10001 read access:

    $sudo install -o 10001 -g 10001 -m 0400 ./validator-credentials.json ./data/validator-credentials.json
    

    Protect the original credentials file separately. Include the credentials when you back up data/. Limit access to these backups.

  3. Add this entry to the node service’s existing environment mapping in compose.yaml:

    CONCORDIUM_NODE_VALIDATOR_CREDENTIALS_FILE: /mnt/data/validator-credentials.json
    

    The existing ./data:/mnt/data mount gives the node access to the file. No separate credential mount is necessary.

  4. Check the Compose file for configuration errors:

    $docker compose config --quiet
    

    Start the node in the background:

    $docker compose up --detach
    

    Follow the logs to check that the node loads the credentials without errors:

    $docker compose logs --follow node
    

    The node produces blocks when the network includes it in the validators for the current epoch.

Verify that a node is a validator node#

Two epochs must have elapsed before you can see the validator ID of the node on the dashboard.

You can use concordium-client to see the status of the node. For more information, see Concordium Client.

$ concordium-client raw GetNodeInfo

...

Consensus type: "Active"

...

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.

Was this article helpful?