> ## Documentation Index
> Fetch the complete documentation index at: https://dittonetwork.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup Validator Node

> Learn how to set up and run a validator node on the Ditto Network

# 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 Setup](#systemd-unit-setup)**

> **[Docker Setup](#running-as-a-docker-container)**

## Systemd Unit Setup

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

### Prerequisites

* Linux debian-based
* Root access to your system

To install node run follow command:

```bash theme={null}
curl -s https://raw.githubusercontent.com/dittonetwork/kepler/refs/heads/develop/scripts/setup-validator.sh | sudo bash
```

You need to enter the validator's private key in hex format.

To create a dedicated kepler user (recommended):

1. Create user:

```bash theme={null}
sudo adduser kepler
```

2. Grant sudo:

```bash theme={null}
sudo usermod -aG sudo kepler
```

3. Switch to user:

```bash theme={null}
su - kepler
```

4. Then run this script with sudo

This script sets up a Kepler validator node on your system. It:

1. Downloads and installs the keplerd binary
2. Initializes the node configuration in your home directory
3. Configures the node with proper gas prices and seeds
4. Sets your private validator key
5. Downloads the genesis file
6. Sets up and starts a systemd service

If you already have a node configured, it will ask before reinitializing.
The script must be run with sudo to install the binary and service.

Look for logs where `height=` keeps increasing, which indicates successful syncing with the network:

```
... INF finalizing commit ... height=12741 ...
```

## Running as a Docker Container

### Prerequisites

* Docker installed
* Docker Compose installed

### Configuration

0. Create the working directory structure:

```bash theme={null}
mkdir -p /home/testnet
cd /home/testnet
```

1. Create a temporary container to generate configuration:

```bash theme={null}
docker run --rm -v $(pwd)/config:/app/config/config -v $(pwd)/data:/app/config/data ghcr.io/dittonetwork/kepler:{{TAG}} /app/kepler init "kepler" --chain-id testnet --home /app/config
```

2. Set up your validator key in `config/priv_validator_key.json`

3. Configure `./config/app.toml`:

```toml theme={null}
minimum-gas-prices = "0.000025ditto"
```

4. Configure `./config/config.toml`:

```toml theme={null}
seeds = "66a5fca8a6a7239e0e0afb8b20938bbe555f5c53@espio.testnet.dittonetwork.io:26666,7fd82c652c04213ba6cfff116ffc92dc7728fd51@vector.testnet.dittonetwork.io:26676"
```

5. Download the genesis file:

```bash theme={null}
curl -s http://espio.testnet.dittonetwork.io:26667/genesis | jq '.result.genesis' > ./config/genesis.json
```

6. Create `docker-compose.yml`:

```yaml theme={null}
services:
  dittonetwork:
    container_name: dittonetwork
    image: ghcr.io/dittonetwork/kepler:{{TAG}}
    network_mode: host
    volumes:
      - ./config:/app/config/config
      - ./data:/app/config/data
    restart: always
```

7. Start the node:

```bash theme={null}
docker compose up -d
```

8. Monitor the logs:

```bash theme={null}
docker compose logs -f
```

Ensure logs show increasing `height=` values, indicating successful network synchronization:

```
... INF finalizing commit ... height=12741 ...
```

## Checking Synchronization Status

To verify your node's synchronization status, run:

```bash theme={null}
curl -s http://localhost:26657/status | jq .result.sync_info
```

Make sure your node is fully synchronized before proceeding with any validator operations.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.