Introduction
Since software version 1.1, we have integrated a Web-UI with the NKN node software in order to simplify miner’s monitoring and configuration of their nodes. This article intends to provide a simple tutorial on how to run NKN node on your home Mac or Linux computer, with help from the Web-UI.
Step 1: Download and install NKN official node software
1.1 Download the latest release
Download the zipped NKN software depending on your computer. Please always check for the latest stable release, since below is just an example.
Mac image download
- 64bit (for 99% of Macs people use today):
https://github.com/nknorg/nkn/releases/download/v1.1b-beta/darwin-amd64.zip
- 32bit (only for very old Mac computer, i.e. built before 2007):
https://github.com/nknorg/nkn/releases/download/v1.1b-beta/darwin-386.zip
Linux image download
- 64bit (for most people):
https://github.com/nknorg/nkn/releases/download/v1.1b-beta/linux-amd64.zip
- 32bit:
https://github.com/nknorg/nkn/releases/download/v1.1b-beta/linux-386.zip
1.2 Install NKN node software
Install NKN node software is very simple: just decompress the zip file and save in a local folder.
Step 2: Modify and save configuration file
2.1 Open configuration file template for mainnet:
https://raw.githubusercontent.com/nknorg/nkn/master/config.mainnet.json
2.2 Save config file
Download and save (Save As) config.json file to local file system, in the same directory as nkn executable files. Your NKN directory should look like this with nknd, nknc, config.json, and web directory.
Step 3: Run NKN node software
Run the following command in a terminal:
./nknd --web-gui-create-wallet
You can see the output on your computer like this.
And you will see a bunch of error messages “wallet file wallet.json does not exist, please create a wallet using nknc.”. Don’t worry, just head to next steps.
Step 4: Create and backup beneficiary wallet
4.1 Create beneficiary wallet
Open the official NKN wallet at https://wallet.nkn.org and create a beneficiary wallet:
4.2 Backup beneficiary wallet
This step is very important, since all your mining rewards will be automatically deposited into your beneficiary address. If you lose access to this wallet, all your NKN tokens will be lost and nobody else can recover for you. So please take a minute and backup right now.
Step 5 Using Web-UI to finalize NKN node
5.1 Create local wallet
Open http://127.0.0.1:30000/web in your web browser. It will ask you to input password in order to create a local wallet. In addition, please fill in the beneficiary wallet address that you created in Step 4.
You might get confused about local wallet versus beneficiary wallet. Please note that each mining node needs a unique local wallet, but many mining nodes can share a single beneficiary wallet. This enables a large mining pool to automatically aggregate all the mining rewards in one single beneficiary wallet, as well as improve security for all the mining nodes. Since compromising any mining nodes will not impact the beneficiary wallet.
Typically it will take 15 minutes or more for a new node to create its ID. This is designed in order to prevent spam attacks. Please be patient and check back after a while.
5.2 Monitor node status
Check your “Node status” at http://127.0.0.1:30000/web/nodeStatus. If there is an orange error message saying “Warning: Local node has no inbound neighbor, it’s possible that local node is unreachable from outside, e.g. behind firewall or NAT.”, it means you need to do port forwarding (TCP/UDP, port 30001-30003) on your home router. You can use a tool like this to check it.
If you see node status becomes “mining” with green dot, it means your NKN node is successfully installed and mining.
Step 6. Managing advanced features
This step is entirely optional, since the default values we baked into the official release of NKN node software can satisfy most people’s needs. Therefore this chapter is for advanced users.
6.1 Monitoring
There are two sections: node status and wallet. And they are all quite self-explanatory.
6.2 Know your neighbors
Each NKN node maintain a list of 50-150 neighbors, and from this tab you can see their ID, IP address, node status, inbound/outbound direction, as well as recent ping latency. These information can be quite useful in debugging, if you believe your node is not running properly.
Note: these are logical neighbors based on NKN’s secure and verifiable routing protocol, and not your geographical neighbor nodes.
6.3 Advanced settings
Typically we do not recommend you change these values. For a complete reference please consult Config.json complete reference for v1.0 [EN].