# Run a Validator Node

## Requirements

### Linux Instance

OS - Ubuntu 22.04 or a higher version

### Specifications

| Specifications | Minimum  | Recommended                                                                                   |
| -------------- | -------- | --------------------------------------------------------------------------------------------- |
| CPU            | 4 Core   | 8 Core                                                                                        |
| RAM            | 16 GB    | 32 GB                                                                                         |
| Disk           | SSD 1 TB | <ul><li>SSD 1 TB 8,000 IOPS</li><li>250 MB/s throughput</li><li>Read latency < 1 ms</li></ul> |
| Network        | > 5 MB/s | > 50 MB/s                                                                                     |

{% hint style="danger" %}
Using a system with minimum specifications increases the risk of reaching full memory capacity, which may lead to [slashing](/run-a-kub-node/run-a-validator-node/slashing.md). Ensure you have enough memory and specifications to support the network data.
{% endhint %}

### Allowed Inbound and Outbound

* Protocol - TCP and UDP
* Port - 30303
* Source IP - 0.0.0.0/0

## Installation

Create a new directory for your validator node

```sh
mkdir -p kub-node && cd kub-node
```

Download the Genesis file and the configuration file using [wget](https://www.gnu.org/software/wget/)

```shell
wget https://raw.githubusercontent.com/kub-chain/bkc-node/main/mainnet/genesis.json
wget https://raw.githubusercontent.com/kub-chain/bkc-node/main/mainnet/config.toml
```

Download the [latest release](https://github.com/kub-chain/bkc/releases); the current version is `v2.4.0`

```sh
wget https://github.com/kub-chain/bkc/releases/download/v2.4.0-bkc/geth2.4.0.linux-amd64.tar.gz
```

{% hint style="warning" %}
Verify that the downloaded version is compatible with your device. KUB supports Darwin ARM64, Linux x86-64, and Linux ARM64. Visit the [latest release](https://github.com/kub-chain/bkc/releases) page to view the available versions under the assets section.
{% endhint %}

Extract the downloaded file

```sh
tar -xvf geth2.4.0.linux-amd64.tar.gz
```

Set the password, replace `YourPassword` with your password

```sh
echo "YourPassword" > ./password.sec
```

Create a new validator account

```sh
./geth --datadir ./data account new --password ./password.sec
```

{% hint style="info" %}
Your public address will be generated after creating the account. Please write it down, as you will need it in the later steps.
{% endhint %}

Initialize the Genesis file

```sh
./geth --datadir ./data init ./genesis.json
```

Run `geth` using the following command and replace `0xYourPublicAddress` with your public address retrieved in the earlier steps

```shell
./geth --datadir ./data \
    --config ./config.toml --password ./password.sec \
    --syncmode snap \
    --mine \
    --unlock 0xYourPublicAddress --allow-insecure-unlock 
```

Please allow some time for your system to download and sync the network data.

### Validator Staking

After successfully installing your node configuration on your system, please proceed to the [next steps](/run-a-kub-node/run-a-validator-node/validator-staking.md). Staking involves depositing the KUB Coin to activate the validator.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kubchain.com/run-a-kub-node/run-a-validator-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
