Skip to main content

Start Validating

Instructions for Running a Node​

See the install & onboard guide for steps on how to prepare the node binary.

1. Adding Verifiable Presentation before starting the network​

Your organisation's VP is sent to you by Gayadeed in the previous step.

If you do not have the VP, you will not be able to propose / vote on blocks and be jailed.

You need to add the verifiable presentation to the config before staring the node.

Add this to the config by running:

dchain vp add <verifiable-presentation>

# Example
dchain vp add eyJ0eXAiOiJ2YytzZC1qd3QiLCJhbGciOiJFZERTQSIsImtpZCI6IiN6Nk1rbU5HRWNRWHZSZmo3WDhFNk55eE0yalI4VGpuMnVyMmc0VnZYNFdIN0tVQzUifQ.eyJpZHgiOjEyNCwidmFsaWRhdG9yIjoiZGNoYWludmFsY29uczFjcjByYWxkN2VlajRqcHczcXp2NWZmN3BrdXk3ZzM2eTh0aGdsYSIsInZjdCI6Imh0dHBzOi8vbWV0YWRhdGEucGFyYWR5bS5pZC90eXBlcy9SbW95bEJOUGlCLVZhbGlkYXRvckRvY3VtZW50IiwiaXNzIjoiZGlkOmNoZXFkOnRlc3RuZXQ6YjUwNGM5NjktNDIyMS00ZjRlLThjZDItYjY2ZjY3OGZkYWY4IiwiaWF0IjoxNzQwNTg1MDIxLCJfc2RfYWxnIjoic2hhLTI1NiJ9.4X1g6_iqC5Ku04JSF1HZBImaV_3nSsP_EakUtgOafLw9ebEXe8Y2n3Zr5P7X9O4g88pF-ZwJKAjBj1-D5IDlDA~

NOTE: The VP is added to the default home "~/.dchain/config". We will fix to take into account of the --home flag in the next version

You can also see what is in the presentation by going to Paradym Debug tool and paste in the presentation.

2. Configure the Node​

Set chain id for the node.

dchain config set client chain-id test-theodoric-2

Add the peers to the $DCHAIN_HOME/config/config.toml.

Please see Networks repo under testnets/test-theodoric-2.

3. Setting up Cosmovisor​

Cosmovisor is a process manager for Cosmos SDK based blockchains that automates the upgrade process of the node software.


# download cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.6.0

This will download cosmovisor to your $GOPATH/bin directory. If the $GOPATH var is not set, it will be downloaded to ~/go/bin.


# move cosmovisor to /usr/local/bin
sudo mv ~/go/bin/cosmovisor /usr/local/bin

Then we have to create the expected directory structure for cosmovisor to work. Details are provided by the cosmos docs


# create the cosmovisor directory
mkdir -p ~/.dchain/cosmovisor/genesis/bin
cp /usr/local/bin/dchain ~/.dchain/cosmovisor/genesis/bin

4. Getting the genesis file​

The genesis file with all the gentx and correct config is provided at the Networks repo under testnets/test-theodoric-2.

Replace the existing default genesis file at the node's home: default in ~/.dchain/config.

5. Starting the Node​


# create the systemd service file
sudo vim /etc/systemd/system/dchain.service

Here is a simple example of the service file, for more details please look at details of Environment variables.


[Unit]
Description=DChain Validator Node
After=network-online.target

[Service]
User=debian
ExecStart=/usr/local/bin/cosmovisor run start
Restart=always
RestartSec=3
LimitNOFILE=65535
Environment="DAEMON_NAME=dchain"
Environment="DAEMON_HOME=/home/debian/.dchain"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"

[Install]
WantedBy=multi-user.target

After we have the systemd file


# reload the systemd daemon
sudo systemctl daemon-reload

# enable the service
sudo systemctl enable dchain

# start the service
sudo systemctl start dchain

# check the status
sudo systemctl status dchain

# check the logs
journalctl -u dchain -f

# stop the service
sudo systemctl stop dchain

6. Promote the node to validate​

In order to join and become a validator, you need to

  1. Have DTs in a validator controller account, create one with dchain keys add <name>
  2. Sign a MsgCreateValidator transaction with the operator account that has the VP added in the attestation.

dchain tx staking create-validator path/to/validator.json --from keyname

where validator.json contains your pubkey, and other info:

{
"pubkey": { "@type": "/cosmos.crypto.ed25519.PubKey", "key": "oWg2ISpLF405Jcm2vXV+2v4fnjodh6aafuIdeoW+rUw=" },
"amount": "10000000000000000000000000adt",
"moniker": "<your validator name>",
"identity": "Please use keybase for logo",
"website": "validator's (optional) website",
"security": "validator's (optional) security contact email",
"details": "validator's (optional) details",
"commission-rate": "0.05",
"commission-max-rate": "0.1",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1000000000000"
}

The pubkey is the represetation of the Validator Address, obtained by running:

dchain comet show-validator

7. Monitoring the Node​

You can monitor the node now with

# check the logs
journalctl -u dchain -f

you should also be seeing your validator is bonded by searching for your moniker in the output of

dchain query staking validators --node <your node rpc>