KUB Docs
  • Introduction to KUB
  • Connect to KUB
  • KUB PoS
    • Increase block gas limit to 90M
    • Update GasPrice Instruction
    • Incident from chaophaya hardfork
    • Overview
    • Considerations
    • Validator Node
      • Node Requirements
      • Run Validator Node
      • Validator Staking
      • StakeManager Contract
      • ValidatorShare Contract
      • Slashing
    • Run Full Node
    • Run Archive Node
    • Chaindata Snapshot
    • Migration PoSA to PoS
    • Delegator
      • How to delegate
      • How to claim reward
      • How to unstake
    • Lausanne Upgrade
  • Developer Center
    • ✨Getting Started
    • 🏆Project Tiers
    • 👨‍💻Connect Bitkub NEXT to register as a new user
    • ✔️Verify your identity via Bitkub NEXT (KYC or KYB)
    • 💰Subscribe to the KUB Developer Package
    • 🗳️Submit your project
      • 📗Create submit project
      • 📘Manage your project
        • Submit project
        • Create a new project version
        • Status of project version
      • 📙Manage project information
  • KUB SDK
    • NEXT SDK
      • NEXT SDK Code Cookbook
      • KUB SDK Compatible Smart Contract
        • Example Smart Contract for Testing
        • Example KUB SDK Compatible KAP20 Smart Contract
        • Example KUB SDK Compatible KAP721 Smart Contract
  • KUB Playground
    • Quick Start Guide on KUB Playground
  • KUB Layer 2
  • KUB Scan
  • RPC Service
    • JSON-RPC Endpoint
  • IPFS Service
    • IPFS Guideline
  • FAQ
  • Glossary
  • Reference and Service
    • KUB Whitepaper Version 3.3
    • Technical Paper Version 3.2
    • KUB Explorer
    • KUB Faucet
    • KUB Oracle
    • KUB Bridge
    • KKUB OTP
Powered by GitBook
On this page
  • Prerequisite
  • Infrastructure Requirement:
  • Installation Steps

Was this helpful?

  1. KUB PoS
  2. Validator Node

Run Validator Node

Fresh setup from 0

Prerequisite

The quickest way to learn about KUB is to run a node and interact with the network.

In this tutorial, we will:

  • Install and run a Validator node.

Infrastructure Requirement:

1. Linux Instance

  • OS - Ubuntu 20.04 LTS or higher version

2. Specifications

Minimum:

CPU 4Core
Ram 16GB
Disk 512GB
Network: more than 5 MB/s

Suggested:

CPU 8Core
Ram 32GB
Disk SSD 512GB 8k IOPS, 250 MB/S throughput, read latency <1ms
Network: 50 MB/s at least

Allow Inbound and Outbound

  • Protocol - TCP & UDP

  • Port - 30303

  • Source IP - 0.0.0.0/0

Installation Steps

Create directory and Download Geth

# Create directory
$ mkdir -p /bkc-node/mainnet

# Download Geth
$ sudo curl -L https://bkc-storage.obs.ap-southeast-2.myhuaweicloud.com/geth/v2.1.0/geth-linux-amd64-go1-18-10 -o /usr/bin/geth
$ sudo chmod +x /usr/bin/geth

Check geth version

geth version

The result after running commands

Geth
Version: 2.1.0-bkc-stable
Git Commit: 8ee545524b9411c306ebb62bcbfa4536264e20c2
Git Commit Date: 20230802
...

Download chain configuration and genesis file

# config.toml
$ sudo curl https://raw.githubusercontent.com/bitkub-chain/bkc-node/v2.1.0/mainnet/config.toml --create-dirs -o "/bkc-node/mainnet/config.toml"

# genesis.json
$ sudo curl https://raw.githubusercontent.com/bitkub-chain/bkc-node/v2.1.0/mainnet/genesis.json --create-dirs -o "/bkc-node/mainnet/genesis.json"

Generating a validator account

# Generate account password
$ echo "<<YourPassword>>" > ./bkc-node/mainnet/data/password.sec

# Generate new account
$ ./geth account new  --datadir ./bkc-node/mainnet/data --password ./bkc-node/mainnet/data/password.sec

# Run
$ ./geth --datadir ./bkc-node/mainnet/data --config ./config.toml \
  --syncmode snap \
  --password ./bkc-node/mainnet/data/password.sec \
  --mine --unlock 0x<<YourAccountAddress>> \
  --allow-insecure-unlock

Initialize a genesis file

# Mainnet
geth --datadir /bkc-node/mainnet/data init /bkc-node/mainnet/genesis.json

Create system service/unit file

sudo nano /etc/systemd/system/geth.service

Furthermore, copy and paste the code below

geth.service
[Unit]
Description=BKC ValidatorNode
After=network.target auditd.service
Wants=network.target

[Service]
Type=simple
ExecStart=/usr/bin/geth --datadir <DIRECTORY_LOCATION> \
    --config <CONFIG_FILE> --syncmode snap \
    --unlock <ADDRESS> --mine --allow-insecure-unlock --password <PASSWORD_FILE> 
KillMode=process
KillSignal=SIGINT
Restart=on-failure
RestartSec=5s
TimeoutStopSec=60

[Install]
WantedBy=default.target 
RequiredBy=swarm.service
Alias=geth.service

Important Configuration for PoS --mine

Enable mining

--datadir <DIRECTORY_LOCATION>

The directory to store the chain data e.g., mainnet: /bkc-node/mainnet/data

--unlock <YourAccountAddress>

an Address that would be unlocked and associated with this node.

--password <YourPasswordFilePath>

The location of the file contains the unlock account password

--config <CONFIG_FILE>

The location of the toml config file e.g.,

mainnet: /bkc-node/mainnet/config.toml

Enable and start the service

sudo systemctl daemon-reload
sudo systemctl enable geth
sudo systemctl start geth

Hint: You can choose whether to be a validator of Solo Node or Pool Node depending on the amount of KUB Coin (KUB) you have. Your reward will be based on the amount of KUB staked on the KUB network.

PreviousNode RequirementsNextValidator Staking

Last updated 3 months ago

Was this helpful?

Next Step: Validator Staking

After you have successfully installed your node configuration on your system. Proceed to the .

​
validator staking