- Run a K2 Validator
There is no minimum amount of KOII required to stake and participate in the voting process.
To participate in the voting process you must configure your system, start a validator, and configure your voting and stake accounts. This guide will show you how to do this.
Here are the minimum hardware requirements for running a K2 Validator in terms of memory, computing, storage, and your operating system:
-
Memory
- 256GB, or more for consensus validator nodes
- 512GB, or more for RPC nodes
-
Compute
- 12 cores / 24 threads, or more @ minimum of 2.8GHz for consensus validator nodes
- 16 cores / 32 threads, or more for RPC nodes
-
Storage
š” Accounts and ledgerĀ *can*Ā be stored on the same disk, however due to high IOPS, this is not recommendedFor consensus validators:
- PCIe Gen3 x4 NVME SSD, or better
- Accounts: 500GB, or larger. High TBW (Total Bytes Written)
- Ledger: 2TB or larger. High TBW suggested
For RPC nodes:
- A larger ledger disk if longer transaction history is required, accounts and ledger should not be stored on the same disk
- GPUs are not strictly necessary
- Network: 1 Gbps uplink and downlink speed, must be unshaped and unmetered
- Operating System
Currently, we are testing our binaries for Ubuntu 22.04. We do provide binaries for other operating systems however the operation of these binaries is not guaranteed.
Once a properly sized Ubuntu 22.04 system is available we can begin to configure the system for operation of a validator node.
All following steps need to be run on the validator server, unless mentioned otherwise.
Ensure your Ubuntu system is up-to-date and has all the base packages required
sudo apt update && sudo apt upgrade
sudo apt install libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang
sudo adduser koii
sudo usermod -aG sudo koii
sudo su koii
cd ~
- Required both on your secure computer for keypair generation and on the validator
sh -c "$(curl -sSfL https://raw.githubusercontent.com/koii-network/k2-release/master/k2-install-init_v1.16.6.sh)"
# You may need to update PATH variable for the cli to be available
echo 'export PATH="/home/koii/.local/share/koii/install/active_release/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Set the koii config to point to the testnet
koii config set --url https://mainnet.koii.network
Run commands for only this step on a secure computer separate from the validator server You need to install Koii cli on this secure computer as well, to be able to use the commands below
We will be creating the following 4 key pairs:
koii-keygen new --outfile ~/validator-keypair.json
koii-keygen new --outfile ~/vote-account-keypair.json
koii-keygen new --outfile ~/stake-account-keypair.json
koii-keygen new --outfile ~/authorized-withdrawer-keypair.json
# To print your Public key(i.e. Wallet address) for any keypairs
# koii-keygen pubkey <Path to Keypair>
- validator-keypair.json : Identity of the validator on the network
- Copy this to the remote validator server at
/home/koii/validator-keypair.json
- Copy this to the remote validator server at
- vote-account-keypair.json : Voting account on the network
- Copy this to the remote validator server at
/home/koii/vote-account-keypair.json
- Copy this to the remote validator server at
- stake-account-keypair.json : Keypair for your staking wallet
- Keep this secure since this will hold the wallet that you delegate stake from
- authorized-withdrawer-keypair.json : Authorized withdrawer keypair, allowd to withdraw funds from your validator vote account ****
If you have firewall software installed you will need to allow traffic on the following ports:
sudo ufw allow 10000:10500/udp
sudo ufw allow 10000:10500/tcp
sudo ufw allow 10899/tcp
sudo ufw allow 10900/tcp
-
Create a file at
/etc/systemd/system/systuner.service
:[Unit] Description=Koii System Tuner After=network.target [Service] Type=simple Restart=on-failure RestartSec=1 ExecStart=/home/koii/.local/share/koii/install/active_release/bin/koii-sys-tuner --user koii [Install] WantedBy=multi-user.target
-
Start and Enable the service to automatically start
sudo systemctl start systuner sudo systemctl enable systuner
Copy the following file to /home/koii/validator.sh
and make it executable
#!/bin/sh
exec /home/koii/.local/share/koii/install/active_release/bin/koii-validator \
--identity /home/koii/validator-keypair.json \
--vote-account /home/koii/vote-account-keypair.json \
--ledger /home/koii/ledger/ledgerdb \
--accounts /home/koii/accounts/accountdb \
--log /home/koii/koii-rpc.log \
--rpc-bind-address 0.0.0.0 \
--rpc-port 10899 \
--gossip-port 10001 \
--dynamic-port-range 10002-10500 \
--enable-rpc-transaction-history \
--known-validator BPRAynHogErzYmEtAaeJFugRozXuU6EEqNa4rEKtF4mS \
--known-validator GqmBXoaetkMXzrMhCijJDsL5J4KDvDFzZuMEpoXYUowc \
--known-validator Hajii3WYcyRWDzENPJwaY2WGtNpYQ7vrCqpgaUi8fsUo \
--known-validator Fme35immspxuG6fboueneNDque5xLu62Ca2BHRuLgTSV \
--entrypoint entrypoint-1.mainnet.koii.network:10001 \
--entrypoint entrypoint-2.mainnet.koii.network:10001 \
--entrypoint entrypoint.mainnet.haji.ro:10001 \
--entrypoint entrypoint-koii-mainnet.stakecraft.com:10001 \
--rpc-faucet-address rpc-faucet.testnet.koii.network:9900 \
--init-complete-file /home/koii/init-completed \
--no-wait-for-vote-to-start-leader \
--enable-extended-tx-metadata-storage \
--maximum-full-snapshots-to-retain 20 \
--maximum-incremental-snapshots-to-retain 20 \
--limit-ledger-size 200000000 \
--only-known-rpc \
--wal-recovery-mode skip_any_corrupted_record \
--expected-genesis-hash 7rVVciNgm2m5JquMbKNxEYPryvzVtDktWhHLM4xFpfjq
Create a systemd unit file at /etc/systemd/system/koii-validator.service
[Unit]
Description=Koii Validator
After=network.target
Wants=systuner.service
StartLimitIntervalSec=0
[Service]
User=koii
Group=koii
LimitNOFILE=1000000
LogRateLimitIntervalSec=0
Environment="PATH=/home/koii/.local/share/koii/install/active_release/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
ExecStart=/home/koii/validator.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
koii config set --url [https://mainnet.koii.network](https://testnet.koii.network/) --keypair ~/validator-keypair.json
Run the following command to create a vote-account on the network:
koii create-vote-account ~/vote-account-keypair.json ~/validator-keypair.json ~/authorized-withdrawer-keypair.json
sudo systemctl enable koii-validator.service
sudo systemctl start koii-validator.service
sudo systemctl status koii-validator.service
The commission rate determines the percentage of staking rewards allocated to the validator as a fee for their services, with the remainder distributed to the stakers. The commission rate must be a valid percentage between 0 and 100.
To update the commission rate for your validator's vote account, use the following command:
koii vote-update-commission <VOTE_ACCOUNT_ADDRESS> <NEW_COMMISSION> --authorized-voter <PATH_TO_AUTHORIZED_VOTER_KEYPAIR>
To update or publish your validator's information on the Koii network, use the following command:
koii validator-info publish "<VALIDATOR_NAME>" -w "<WEBSITE_URL>"
Commands in this section are to be run on the computer which has the stake account key pair (NOT ON VALIDATOR)
Run the following command, AFTER replacing <AMOUNT_TO_STAKE>.
koii create-stake-account ~/stake-account-keypair.json <AMOUNT_TO_STAKE> --stake-authority ~/validator-keypair.json --withdraw-authority ~/authorized-withdrawer-keypair.json
koii delegate-stake ~/stake-account-keypair.json ~/vote-account-keypair.json --stake-authority ~/validator-keypair.json --force
Your validator will not show up in the koii validators list for 12 to 24 hours, you can check your stake to make sure it is properly delegated by running the following command
koii stake-account ~/stake-account-keypair.json
Expected output:
Balance: <Amount of KOII>
Rent Exempt Reserve: <Amount of KOII>
Delegated Stake: <Amount of KOII>
Activating Stake: <Amount of KOII>
Delegated Vote Account Address: <pubkey>
Stake Authority: <pubkey>
Withdraw Authority: <pubkey>
If you see a value in āActivating Stakeā then you should be successfully voting within 24 hours