NKN Mining Guide for Mainnet: wiki version

NKN%20Mining%20Machine

Significant recent changes

Since this FAQ is updated only periodically, please carefully read this section first for any significant changes to the mining process!

We released a new mainnet version v2.1.2, which contains several significant security updates that greatly enhance the network security. This is relevant to EVERY miner, please update now.


The most noticeable change is adjusting Generate ID fee while invalidating all existing node ID. Please read more details about this security enhancement & what to do at

And the most convenient and inexpensive way to acquire the NKN Mainnet token to start mining

We recommend using our partner swap service SWFT. It is not advised to get ERC-20 tokens and then swap, since it will incur gas fees on both the initial purchase as well as the swap.

https://medium.com/nknetwork/swft-added-support-for-nkn-mainnet-and-nkn-erc-20-token-swap-df64644876d

Welcome newcomers

Mining can sound daunting for newcomers, especially when you hear about the expensive ASIC based Bitcoin mining machines or very high end cloud servers needed for other leading blockchain projects.

Fear no more, NKN mining software requires inexpensive computers (home routers or network hard disks, old laptops, and $5 virtual machines on cloud) and are super easy to run for non-technical person. We created true 1-clicks, Web user interfaces, and automated scripts to make it easy, super easy.

If you are a NKN testnet veteran, you can safely skip this chapter and proceed directly to the next chapter.

What is NKN mining?

In blockchain world, mining simply means doing some useful work to earn cryptocurrency or tokens. For NKN, miner earns NKN tokens by sharing their network connection and relaying data. In addition, miners work together to ensure the network is safe and secure. So miner’s role is crucial for the NKN ecosystem.

Is it profitable?

Maybe, it depends on a few factors:

  • NKN token price
  • How many nodes are actively mining at the moment
  • Your cost of running the node
  • Your luck

The rate NKN tokens are being mined is constant for each year, and they are shared by all the mining nodes on the network. nstatus.org shows a realtime calculation of averaged monthly mining reward per node.

The good news is that there is zero cost to try out NKN mining: most cloud providers has free trial credits ($100-$300); or if you mine from home, you can re-use idle or old computers. After the free credits are used up, you can make your own calculations if it is profitable for you or not.

Do I need to stake or own NKN to mine?

[2021 update]: To prevent security attacks, we introduced a 10 NKN token fee for a new node to generate ID. Other than this initial fee, there is no other staking or ownership of NKN tokens required.

The fee is deposited back into a Mining Bonus Address, and automatically add to everyone’s mining reward over time. For more details about the reason and practicals of this 10NKN fee, please read the following article.

What kind of computer do I need to mine?

To mine, you need to run a NKN software called full node software on a computer that has an Internet connection. There are some basic requirements on the computer:

  • Has a minimum of 512MB of RAM (1GB is recommended)
  • Has a minimum of 16GB of disk (25GB or more is recommended)
  • Most CPU (Intel, AMD, ARM, MIPS) will work
  • Have a fast Internet connection (>10Mbps) is important
  • You have either a public IPv4 address or are able to configure port forwarding on your router (TCP/UDP ports 30001-30021). Optionally you can enable TCP ports 30022-65535 for NKN Commercial services like nConnect.

It can be one of the following:

  • A cloud virtual machine from any cloud service providers: we officially support DigitalOcean, Google Cloud Platform, AWS, Oracle Cloud; but many of our community members successfully run their nodes on all kind of cloud computing providers.
  • A home computer: desktop of laptop, Windows or Mac or Linux
  • A home embedded device such as a Raspberry Pi, WiFi router, Network Attached Storage (Network Disk), or a TV box

I’m a newbie, what is the easiest way to mine?

The easiest ways at the moment are:

  1. 1-click cloud deployment (see the chapter on “Mining on cloud computer”)
  2. “Fast Deploy” from nknx.org (see next section)
  3. Joining a mining pool like npool.io

nknx.org and “Fast Deploy”

nknx.org, a community project, has recently implemented “Fast Deploy” method. By using a single line of script (copy pasted into your computer’s command line), you can deploy NKN nodes software on cloud machines or home computers, and automatically registered on nknx.org for monitoring.

Here is a recent step-by-step experience of “Fast Deploy” for a home Raspberry Pi computer:

Or deploying NKN Commercial on Oracle Cloud using NKNx Fast Deploy:

npool.io community mining pool

Npool is a mining pool that focuses on NKN node mining. Not only provides a simple and quick way to access the NKN network, but also makes mining income more consistent and predictable. Please visit the official website: https://npool.io

I’m stuck, who can help me?

If you cannot find the answer in this FAQ, here are some very useful resources:

  1. Search our https://forum.nkn.org/c/nodes-mining for related posts. And if you cannot find anything related to your problem, you can ask a question by creating a post on the forum. This is recommended, since future newcomers will benefit from the knowledge we accumulate in the forum.
  2. Join our Discord #mainnet channel https://discord.gg/yVCWmkC, ask a question, and mostly likely someone will answer. This is ad hoc support by NKN dev team and community, so please be patient if you don’t get near real-time responses.

Welcome back: testnet veterans

What has changed since testnet?

A lot! You might want to check our release note for v1.0 as well as subsequent releases.

One relevant change is that you can no longer use the same wallet across many mining nodes. Each mainnet mining node needs its unique wallet. To simplify management, we introduced BeneficiaryAddress so mining rewards from many mining nodes can automatically deposited into one single beneficiary wallet. This also increases security of miner’s mining rewards. All the new instructions, 1-clicks, and Fast Deploy will show your how to configure the BeneficiaryAddress.

Can I upgrade from testnet node to mainnet?

It is certainly feasible for 1-click cloud images, but we do not recommend it. The reasons are simple:

  • Mainnet is significantly different from testnet, and incompatible
  • Wallet, blockchain data, and a lot more have changed since testnet
  • You node most likely will need an Operating System upgrade and thorough security patch anyway

Mining on cloud machines

1-click cloud deployment is one of the signatures of NKN, since we pioneered it since February 2019. All you need to do is to register an account in one of three leading cloud platforms, follow our links or search for NKN in their marketplace, and follow the instructions there.

Summary of all three cloud platforms updated for NKN mainnet:

Most cloud providers has free trial credits, so there is zero cost to try out NKN mining

  • DigitalOcean provide $100 credit for three months via referral link
  • Google Cloud Platform provides $300 credit for 12 months
  • AWS provide 1 free T2-Micro virtual machine for 12 months

DigitalOcean (DO)

Google Cloud Platform (GCP)

Amazon Web Service (AWS)

Mining at home

Mining at home is probably the most economic way to run NKN, since you have already paid for your Internet connection and can reuse some of the computers at home you don’t use. For most people, there is almost zero monthly cost to run a NKN node at home.

Public IPv4 address and port forwarding

There are some limitations of mining at home, since each NKN mining node needs a unique public IP address.

  • If your router does not support uPnP, then you need to configure port forwarding to make NKN software working. You need to be able to log into your router and configure port forwarding for 30001-30003 (TCP and UDP). And because there are hundreds of different types of routers out there, there is no standard way to log in and configure them.
  • Most home Internet Service Providers only give home users 1 public IP address per household, so technically you cannot run more than 1 NKN node.

You can use this tool to check your public IP address and if the ports are open or not:

And here are some general guides on how to configure port forwarding in leading brands of home routers:


I have an extra computer at home, how I can I mine?

Since mainnet release v1.1, a built-in Web-UI simplifies monitoring and configuration for miners. Here are the step by step guides for Windows, Mac, and Linux on your home computers:

Mac and Linux guide:

Windows guide:

How can I mine with Raspberry Pi, wifi routers, NAS, and TV set top box?

The instruction really varies depending on your particular device. Here are a few guides but many of them might be outdated. Please contact the original author for updates.

Raspberry Pi (mainnet, via nknx.org Fast Deploy)

Raspberry Pi (testnet, manual, might be outdated)

OpenWRT WiFi routers (testnet, might be outdated)

Phicomm N1 Network storage device (in Chinese, might be outdated)

Monitoring, updates and maintenance

Wallet and explorer

The official NKN wallet is:

The official NKN explorer is:

https://explorer.nknx.org

To check if your node is working properly:

https://explorer.nknx.org/ips

Miner portal

Right now the best miner tool is nknx.org, which is a combination of node and wallet manager with miner focused portal. Nknx.org is developed and maintained by the nknx community team, and they have a Discord channel if you have any questions.

Command line interface CLI

The NKN client (nknc) is the CLI for NKN. For complete refernce:

Do it yourself local monitoring

If you have many mining nodes, can do some coding and do not want to monitor your nodes through nknx.org, here is an alternative by community developer lightmyfire (co-author of nknx.org):

Another alternative developed by community member AG. It was designed for testnet, so you need to update yourself to make it work for mainnet.

Why I’m not getting any NKN mining reward?

Why I’m not getting the average mining reward over long period of time?

How do I update my NKN Mining node?

NKN core dev team regularly release new NKN full node software, in order to enhance security, improve security, add new features, and fix bugs. So what should miner do?

  • If you deployed your node via 1-click cloud image, nknx.org Fast Deploy, or have auto-update scripts in your mining node, you do not need to do anything. The node will update itself, within 24 hours of the official release. If you are impatient to get the latest release, you can always reboot your mining node to do the auto-update right away.
  • If you installed using the binary or executable files from official release: you just need to download the latest binary files, decompress and overwrite the older existing files. Just be careful if you have changed config.json file and you don’t want it to be overwritten.
  • If you compiled the software from source during installation, you can fetch the latest release code and re-build.

Contributing to NKN software development

NKN is an open-source community project. We have a highly competent but small core developer team, and fortunately a group of dedicated community developers joined us over the last 15 months. But we need your help.

Contribute to NKN core software development

New Kind of Proposal (NKP) process

New Kind of Proposal or NKP, is the NKN community process for submitting, reviewing, debating, and deciding on changes and improvements to the NKN blockchain ecosystem. Both technical and economic changes are covered by NKP.

Examples of recent NKPs:

  • [NKP-0013] P.E.D.S - Persistent data storage

  • [NKP-0014] Use PoW to prevent generate ID txn spam (implemented in v1.1)

  • [NKP-0015] Removing inactive ID to reduce database size

Building application on top of NKN

You can start from the Developer Portal:

https://www.nkn.org/developer/

Our developer SDKs are here:

The technical documents are here:

And our Discord dev channels are the best place to hang out:

References

  1. The original Mining FAQ was written by community developer ChrisT. It has not been updated for mainnet but still has lots of good information:
3 Likes

Hi admin, I am a newbie and I would like to have a node in the cloud to undermine NKN, either with digital ocean or any of the other 2 providers, I would like some member of the community to advise me which to activate, that is not so complicated to my for my newbie quality, it catches my attention to do it with digital ocean, I wait for advice and thanks in advance

admin, could you send me a referral link for the promotion of the $ 100 for 3 months of testing in digital ocean, thanks

Hello can I pay someone to install this all for me via team viewer im a complete newbie at this.

Hi,
will somebody clarify Version’s difference:

  • v1.1.3-beta-3-g06d8;
  • v1.1.3-beta?
    Thanks.

I cannot for the life of me get ports 30001-30003. I have configured port forwarding correctly on my router. I have several other ports forwarded and they work correctly. Never had issues like this simply forwarding a port.

Are you deploying from github src code or binary release?

I believe the latest nknd needs more ports open, e.g. 30001-30021, in order to work properly. Hope it helps.

I got asked a lot: “how come my node does not have any reward”, “my node seems to generate too little reward”, “how can I improve my mining reward”, and so on. So here is one general answer

There is really no secret to mining. There are only two factors

  • How much you relay and contribute to the network
  • Your node’s luck

The former is related to your node quality (especially your Internet connection and how fast your node can relay packets). There are some difference between cloud VM and home computers. Cloud VM has some edge but home computer has almost no cost. My 1Gbps fiber connected home Raspberry Pi performs almost as good as cloud VM.

The latter varies a lot (e.g. day to day or even week to week), but over a long period of time (3-6 months) it evens out.

1 Like

hola he visto que nkn se ha asociado con ankr.
¿de esta manera se podra ejecutar un nodo nkn a traves de ankr?

Hi I think it might be possible to run nkn node via Ankr. We did integration early last year, but it might not be updated since.

estuve mirando en ankr no vi ninguna opcion para ejecutar un nodo nkn. supongo que en un futuro si daran la opcion

Hey!

So I finally downloaded ChainDB, and have been running the node for 1 day already, but I do not see any mining rewards.
I have 2 nodes - in Russia and in US pointing to the same wallet through the beneficiary address.
Can you please give some estimates on how often will I get the reward?
UPD: see the answer NKN Mining Guide for Mainnet: wiki version, which makes sense, but want to make sure that the problem below does not affect the mining.

I often see “Wait for reply timeout” errors and just saw “https server is unavailable yet”, but some activity is happening and the ChainDB is syncing. Is that OK?

As long as your node is in “Persist_finished” state you are fine. There are some warning and error messages in log, only for development purpose.

2 Likes

OK, it is. Thank you!

I finally got my first tokens, which is great!)
Now I have a question - is it possible to understand from which node tokens came to my beneficiary addr?
I have 2 nodes, and want to check which of them produced tokens.
Can I somehow understand from LOG files?

add your nodes to nknx.org (ip) and there it says how many blocks every node have mined

1 Like

You can check the IP for the node in nstatus. then where it says “proposalSubmitted:” look to see if there is any number over 0. if so that node hit that many blocks since it has been running. If the node shut down then the counter starts over from 0.

Hello everyone!
I have a couple of questions, I would much appreciate it if anyone could help clarifying it for me.

We have deployed about 325 nodes in the last 7 days with a common beneficiary address, majority of the nodes are in “PERSIST_FINISHED” state and as I understand that means they are doing their job, though when I check the beneficiary address on nscan.io, it shows “5 transactions” of type “subscription”.

What does that mean?
If they were subscription from nodes, shouldn’t I see all 325 nodes’ subscription to the wallet?

Plus, when should we expect a reward? Is it really $7 a month for each node deployed? image

So far we haven’t received a penny :smile: it would be good to see the wallet lifting off, as a form of encouragement.

Thanks all

Hi,

First of all, subscription has nothing to do with normal mining reward. They are typically related to value added services like nConnect, TUNA and etc.

When you launch a node, sometimes it takes the first couple of days to sync up to the latest blockchain data. Then it reaches “persist_finish” status and actually started mining. So maybe your nodes reached mining state less than 7 days ago.

Currently it take on average 30 days for each node to get a block reward. So it does seem a bit unlucky that you have not received any block reward. Depending on how you deployed the nodes, you might want to check if Beneficiary Address is properly configured for all the nodes.