NKN node guide

Hardware requirements

Guide

Updating node

Useful links

Special thanks to following resources:

Hardware requirements

Coins to launch miner: 10.1 NKN coins

Operating system: Ubuntu is recommended (works perfectly with Debian)

Memory: 1GB

CPU: 1 CPU

Disk space: ~20 GB

Internet connection speed: 10Mbps up and down is a minimum

IP address: 1 IP version 4 (IPv4)

Ports: TCP/UDP ports 30001-30021

Guide

  1. Update & install newest versions of the packages for OS. And install packages make; curl; git :
apt-get update
apt-get upgrade -y
apt-get install make curl git -y
  1. Add NKN user:
adduser nkn
  1. Give nkn user super user rights adding it to the sudo-group. And switch to nkn user. Open home directory of nkn user:
usermod -aG sudo nkn
su nkn
cd ~
  1. Install latest Go version (installing go1.17.3):
sudo wget https://golang.org/dl/go1.17.3.linux-amd64.tar.gz && sudo tar -C /usr/local -xvf go1.17.3.linux-amd64.tar.gz
  1. Update env variables to include go:
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF

source .bashrc
  1. Check go version
go version
  1. Create nknorg folder and change directory to that folder:
mkdir -p ~/go/src/github.com/nknorg && cd ~/go/src/github.com/nknorg
  1. Copy NKN repository to current folder (nknorg)
git clone https://github.com/nknorg/nkn.git
  1. Open nkn folder
cd nkn
  1. Build the source code with make command
make
  1. Copy existing config.mainnet.json file to config.json
cp config.mainnet.json config.json
  1. Create separate wallet for rewards using https://wallet.nkn.org/. NOTE: Save secret seed and related account details (public key, password). You will need to use secret seed & password to recover your wallet.

  2. Create local wallet using command below. NOTE: Save file wallet.json and related account details (public key, password). You will need to use wallet.json & password to open your wallet using website https://wallet.nkn.org/ and to run NKN node.

./nknc wallet -c
  1. Send 10.1 mainnet NKN coins to a local wallet (created in above paragraph with command ./nknc wallet -c)

  2. Go to home folder and create service file to run NKN node in the background.

NOTE: Change <YOUR_WALLET_PASSWORD> in the service file below to the password from your local wallet

cd ~

sudo tee /etc/systemd/system/nkn.service > /dev/null <<EOF
[Unit]
Description=nkn

[Service]
User=nkn
WorkingDirectory=/home/nkn/go/src/github.com/nknorg/nkn
ExecStart=/home/nkn/go/src/github.com/nknorg/nkn/nknd -p <YOUR_WALLET_PASSWORD>
Restart=always
RestartSec=3
LimitNOFILE=500000

[Install]
WantedBy=default.target
EOF
  1. Load service and start
sudo systemctl daemon-reload
sudo systemctl enable nkn
sudo systemctl start nkn
  1. Check status of service
sudo systemctl status nkn
  1. Check logs:
journalctl -f -u nkn

Updating node

  1. Stop nkn service:
sudo systemctl stop nkn
  1. Go to nkn directory:
cd /home/nkn/go/src/github.com/nknorg/nkn
  1. Update current folder with up to date github repository:
git pull
  1. Clean old files & build the source code with 'make' command:
make deepclean
make
  1. Start nkn service:
sudo systemctl start nkn
  1. Check logs that everything works fine:
journalctl -f -u nkn

Useful links

NKN website: https://nkn.org/

NKN telegram: https://t.me/nknorg

NKN discord: https://discord.com/invite/hrZvrVa

Create wallet using web: https://wallet.nkn.org/

Check node status: http://nstatus.org/

NKN explorer: https://nscan.io/