How to deploy an NKN node to your favorite VPS with NKNx FastDeploy within seconds

WizardOfCodez
nknx
Published in
7 min readJun 30, 2020

0. What you need

Before we start creating your miner make sure you have 3 things:

  1. An NKN mainnet wallet to receive mining rewards (either use https://wallet.nkn.org or https://vault.rule110.io to create one — save your wallet data!)
  2. An active account on your VPS provider of choice (check step 1 for some bonus offers!)
  3. An NKNx account

Everything set? Then let’s go!

1. Create your API credentials

First, you need to make a quick stop at your VPS provider to create the API credentials needed by NKNx.

a. Vultr

Pre note: if you haven’t already signed up for a Vultr account yet you can support us by using our referral link: https://www.vultr.com/?ref=8831633-6G. With it, you will get $100 in free credit and we will get $35 when you decide to make a purchase — win/win!

Log in to your account at https://www.vultr.com/. On the left navigation panel click on “Account”. Now on the main content navigate to the tab “API” and enable API access by pressing the “Enable API” button.

Before copying your API key scroll down to “Access Control” and add the NKNx main server to the allowed IPs. Enter 88.198.149.44 / 32 and click the “Add” button.

Now you can copy your API key.

Gratulations! You now got yourself a Vultr API-key!

b. DigitalOcean

Pre note: if you haven’t already signed up for a DigitalOcean account yet you can support us by using our referral link: https://m.do.co/c/453226dca9fc. With it, you will get $100 in free credit and we will get $25 when you decide to make a purchase — win/win!

Log in to your account at https://digitalocean.com. On the left navigation panel click on “Account->API”. Now on the main content under “Personal access tokens” Click the button “Generate New Token”

On the pop-up window give your token a good name and make sure the option “Write (optional)” is checked. After that click on “Generate Token”.

Now you can see your DigitalOcean API-Key in the overview. Make sure to copy your token now because you will not be able to see it again after leaving the site.

Gratulations! You now got yourself a DigitalOcean API-key!

c. Hetzner

Pre note: if you haven’t already signed up for a Hetzner account yet you can support us by using our referral link: https://hetzner.cloud/?ref=wzlPqNKEmzN7. With it you will get €20 in free credit and we will get €10 when you decide to make a purchase — win/win!

Log in to your account at https://accounts.hetzner.com/login. Make sure you’re on the cloud management interface. Your browser should point to https://console.hetzner.cloud/.
Now select the project you want to create your API key for. New users can choose the Default project.

On the left navigation panel click on “Security”. Now on the main content navigate to the tab “API-Tokens” and click on “Generate API token” on the upper right side.

On the pop-up window give your token a good name and click “Generate API Token”. You can now see the API-Token. Make sure to copy your token now because you will not be able to see it again after leaving the site.

Gratulations! You now got yourself a Hetzner API-key!

d. Amazon Web Services

Log in to your EC2 account at https://console.aws.amazon.com/ec2/v2/home. From the header menu choose “Private->My Security Credentials”

Expand the accordion “Access keys (access key ID and secret access key)” and click the button “Create New Access Key”. On the popup click on “Show Access Key” and copy out your Access Key ID and Secret Access Key. You will need both to connect with NKNx. Make sure to copy your credentials now because you will not be able to see it again after leaving the site.

Gratulations! You now got yourself some AWS API credentials!

2. Store your credentials in NKNx

Now you can store your credentials in NKNx! Click on your user icon in the left sidebar (at the bottom) and choose “Account”.

On the “Account Settings” page activate the tab “VPS keys”, choose your provider, give it a good name and paste your API credentials. Add them by pushing the button “Add”.

3. Deploy your nodes

Now let’s go to work! Click the FastDeploy icon in the left menu bar. On the Fast Deploy page, we first need to create a new configuration to deploy. Label it accordingly and paste the NKN mainnet address of your wallet you created in step 0.
Reminder: This is the NKN mainnet wallet where mining rewards should be sent to. Make sure this is a mainnet wallet (see step 0). The wallets provided on exchanges are ERC-20 tokens which don’t work and therefore are not allowed to be used with FastDeploy.

After that is done let's check the other available options:
The “Disable UFW?” option should be left disabled for security reasons unless you know what it’s doing. This allows you to disable the internal Linux firewall FastDeploy automatically installs out of the box.

You also have the option to choose from different Sync Modes:

  1. Fast Sync: A “normal” NKN node with all blockchain data stored on the harddisks. Blockchain syncing is done by the node itself. Takes up to >25GB at the time of writing.
  2. Lite Sync: A “light” NKN node with a minimized version of the blockchain. Can be used for mining but does not have all chain data available when you want to use the node for development. Takes up to >4GB at the time of writing.
  3. Snapshot Sync: A “normal” NKN node with all blockchain data stored on the harddisks. FastDeploy downloads a pre-pruned chain and adds it to the node for faster syncing. Takes up to >25GB at the time of writing.

Add this configuration by pressing “Create”. If this button is greyed out you possibly put in the wrong Beneficiary Address (wallet address has to start with NKN because it is a mainnet address). Check your inputs again!

Now select the configuration you just created. The providers where you provided an API key should become active. Click on the desired one to open the deployment window.

On it choose server size, region, and the number of nodes. Don’t forget to give your nodes a good name. NKNx automatically increments the number of your nodes so you can get a good overview. If you change the name of the first node all your other nodes will change in name too. You can deploy a maximum of 20 nodes per batch.

After hitting “Confirm” your nodes should appear in your VPS provider's dashboard. Also, NKNx tracks the installation status of all your nodes and adds them to the node manager if installation is finished.

Need 10 Mainnet for getting started?

Since May 2021 each NKN node needs to pay 10 NKN mainnet tokens to participate in the network and therefore earn mining rewards. This can get pretty challenging if you are new in the NKN ecosystem.

Luckily NKNx offers an easy way to obtain NKN mainnet tokens without any hassles. So make sure you check out our Node ID generation service. You can learn all about it here: https://medium.com/nknx/introducing-the-nknx-node-id-generation-service-17b6fc970d66

And that’s all, folks!

We hope you find the new FastDeploy function of NKNx helpful. If you don’t want to share your API keys with us you can still use the “Custom” option and gather a terminal snippet to post in any Linux command line.

If you got any questions don’t hesitate to contact us on Discord, Twitter, or at hello@nknx.org.

--

--

WizardOfCodez
nknx
Editor for

🧙🏻‍♂️ Full Stack Web Dev and CTO of https://mdxalgo.com. I also made https://getsurge.io and https://nscan.io because I was bored. 🧙🏻‍♂️