Setup Validator Node

This guide will walk you through setting up a validator node on the Ditto Network. You can choose between running the node directly on your system or using Docker.

Systemd Unit Setup

All commands in this section should be executed as the root user.

Prerequisites

  • Root access to your system
  • jq utility installed
  • Basic knowledge of systemd

Installation Steps

  1. Install jq if not already installed:
apt-get update && apt-get install -y jq
  1. Create the working directory:
mkdir -p /home/kepler
  1. Download the appropriate binary for your OS from Kepler Releases to /home/kepler

  2. Unzip the archive and set up the binary:

cd /home/kepler
chmod +x keplerd
  1. Initialize the node:
mkdir -p /root/.kepler/
/home/kepler/keplerd init "NODENAME" --chain-id testnet

Configuration

  1. Set the gas price in /root/.kepler/config/app.toml:
minimum-gas-prices = "0.000025ditto"
  1. Configure seeds in /root/.kepler/config/config.toml:
seeds = "66a5fca8a6a7239e0e0afb8b20938bbe555f5c53@espio.testnet.dittonetwork.io:26666,7fd82c652c04213ba6cfff116ffc92dc7728fd51@vector.testnet.dittonetwork.io:26676"
  1. Download the genesis file:
curl -s http://espio.testnet.dittonetwork.io:26667/genesis | jq '.result.genesis' > /root/.kepler/config/genesis.json

Service Setup

  1. Create the systemd service file at /etc/systemd/system/kepler.service:
[Unit]
Description=Kepler Network
After=network.target

[Service]
User=root
ExecStart=/home/kepler/keplerd start
Restart=always
StartLimitBurst=999

[Install]
WantedBy=multi-user.target
  1. Start and enable the service:
systemctl daemon-reload
systemctl start kepler.service
systemctl enable kepler.service
  1. Check the service status:
systemctl status kepler.service
  1. Monitor the logs:
journalctl -u kepler.service -f

Running as a Docker Container

Prerequisites

  • Docker installed
  • Docker Compose installed
  • jq utility installed
  • Golang installed

Installation Steps

  1. Clone the repository:
git clone https://github.com/dittonetwork/kepler.git
  1. Build the binary:
cd kepler
go build -o main ./cmd/keplerd
  1. Build the Docker image:
docker build --pull --rm -f 'Dockerfile' -t 'kepler:testnet' '.'

Configuration

  1. Create the working directory structure:
mkdir -p /home/testnet/{config,data}
cd /home/testnet
  1. Configure ./config/app.toml:
minimum-gas-prices = "0.000025ditto"
  1. Configure ./config/config.toml:
seeds = "66a5fca8a6a7239e0e0afb8b20938bbe555f5c53@espio.testnet.dittonetwork.io:26666,7fd82c652c04213ba6cfff116ffc92dc7728fd51@vector.testnet.dittonetwork.io:26676"
  1. Download the genesis file:
curl -s http://espio.testnet.dittonetwork.io:26667/genesis | jq '.result.genesis' > ./config/genesis.json
  1. Create required empty files:
echo '{}' > ./config/addrbook.json
echo '{}' > ./data/priv_validator_state.json
  1. Create docker-compose.yml:
services:
  dittonetwork:
    container_name: dittonetwork
    image: kepler:testnet
    network_mode: host
    volumes:
      - ./config:/app/config/config
      - ./data:/app/config/data
    restart: always
  1. Start the node:
docker compose up -d
  1. Monitor the logs:
docker compose logs -f

Checking Synchronization Status

To verify your node’s synchronization status, run:

curl -s http://localhost:26657/status | jq .result.sync_info