ALLinONE-nknnode script, deploy nodes faster, with your own ChainDB!

Intro:

NKN network miners need a local blockchain database to operate. It would take days to synchronize that database (ChainDB) directly from other miners over the network. BUT, if you already have a fully synchronized miner, there’s a way to archive the database, copy it and use it to deploy your new miners very fast. There’s also an option to download a copy directly from NKN .org (server could be overloaded).

ALLinONE-nknnode script at Github:

ALLinONE-nknnode 1.5.0 - Script features:

  • NO spyware etc.
  • Beginner mode: download/host ChainDB and install first NKN node
  • Download ChainDB from NKN org and host it on THIS server
  • Download ChainDB from known custom URL and host it on THIS server
  • Create ChainDB from own node and host on the SAME server
  • Create ChainDB from own node and host it on ANOTHER server
  • Update old ChainDB file (only for chaindb hosts that also have a node installed)
  • Custom URL for ChainDB node deploy (fast)
  • no ChainDB deploy (starts syncing from 0, takes up to 5 days)
  • Transfer NODE ID / wallet
  • in-script node monitor (no112358)
  • nWatch website node monitor (AL-dot-debug)
  • Flags for fast installation

This script was tested on Ubuntu 20.04 server.
If you come across any bugs please let me know. Thank you!

PREPARATION:

  1. DO NOT USE Google Cloud server, AWS (Amazon “Free”), AZURE! They have hidden fees for traffic etc. Many reported high bills. Stick with Servercheap.net, Digital Ocean, Linode, Vultr, UpCloud, Hetzner… Get your free service coupons at https://vpstrial.net/vps/ for free servers for a few months. Create an account at these sites to deploy a VPS server.

  2. Go to wallet.nkn.org to create a wallet, use a 20 character strong password, you can generate passwords at https://passwordsgenerator.net/ . After creating the wallet, save the secret seed number to a file along with your password and also download the wallet for another way to restore your wallet account. Make backups of it. Copy the NKN address as this will be your beneficiary address where you’ll get paid.

  3. To fully deploy a NKN node, you have to invest 10 mainnet NKN (not ERC-20 based NKN) PER NODE, or else the server won’t start working. Link to get you started Guide: NKN’s official mainnet token swap tool

  4. Deploying a server on VPS provider: use Ubuntu as operating system and for the very first server choose a server with 35+ GB of storage, so we can create a node and a ChainDB server on it.

    VPS server sizes:
    To deploy a ChainDB and node: 35+ GB
    To deploy ChainDB only: 25 GB
    To deploy NKN nodes: 25 GB

    Private IP check (Linode)
    Be sure to “disable” VPS provider firewalls!

  5. Connect to the VPS server with software like MobaXterm,Terminus,Putty, via the provided IP address and the password you choose or was provided to you by the VPS service website.

VPS FIREWALLS:

Node server runs it’s own firewall, so there’s no need for VPS provider firewalls.

STARTING THE SCRIPT:

  1. Switch to root user if not root yet:
    sudo su -

  2. Start the script in terminal with this command:
    wget -O nkndeploy.sh 'https://raw.githubusercontent.com/no112358/ALLinONE-nknnode/main/nkndeploy.sh'; bash nkndeploy.sh

START SCRIPT WITH FLAGS

  1. Switch to root user if not root yet:
    sudo su -
  2. Start the script in terminal with this command (be sure to single quote the flag values):
    wget -O nkndeploy.sh 'https://raw.githubusercontent.com/no112358/ALLinONE-nknnode/main/nkndeploy.sh'; bash nkndeploy.sh -p 'password' -b 'beneficiaryaddress' -w 'chaindbURL'

Donate to me:

NKN ERC-20: 0x66b328fc3d429031ee98f81ace49b401f53f2afd
NKN MAINNET: NKNFLRkm3uWZBxohoZAAfBgXPfs3Tp9oY4VQ
BCH: 1Hn2wqtxj7paiXWqLwfgbuPoLpvvvFVFnW

Script pictures:

1 2 3 4

Debugging after installation:

Root user: sudo su -

Find NKN miner directory: cd "$(find / -type d -name "nkn-node" 2>/dev/null)"

Check node status (same as nStatus.org): ./nknc info -s

Use command ls to look for nkn-node.log or nkn-node.log.1

Open with: nano nkn-node.log or nano nkn-node.log.1
Exit with CTRL + X move up and down with page up & page down keyboard button

Look at node service and what beneficiary address is set:
systemctl status nkn-commercial.service

Look at system journal:
journalctl -u nkn-commercial.service
Exit with CTRL + C move up and down with page up & page down keyboard button

Changing beneficiary wallet address:

9 Likes

Thank you for sharing with the community, kudos!

need to fix a few bugs, sorry for that, will make it work.

copy paste from windows txt file via terminal to nano, totally destroys the script structure… annoying.

fixed quite a few :smiley:

1 Like

This is very good, I was working on a bash script like this, thanks for sharing.

You could add this script on github, on github new users will be able to add commits to improve the script and fix possible bugs.

Take the script and do what you want :smiley:

I don’t wanna deal with github etc.

@zbruceli I’ve reached maximum edit count, haha I have to wait to fix a word I misspelled :smiley:

I have upgraded your trust level, you should be able to edit more now. pls try again.

1 Like

still can’t edit, says i have to wait 3 hours :smiley:

This is a great script. Made installation a breeze! Very grateful this is here as a resource.

:+1: :+1: :+1: @no112358

1 Like

Thanks :smiley:

very good thank you, could you add a part where the script could autmatically add the node to nknx node manager ?

can’t do that and even if I could I wouldn’t, karma reasons :smiley:

care to explain ?

I can’t because nknx site uses secret api to do that, and I wouldn’t because it’s not fair to take profits from the NKNX team and then use their site for free.

@zbruceli Hi Sir , I’m a newbie planning to add more nodes . I only tested 1 node currently, noticed that has been mining for a week now and still no NKN mined . How many nodes it needs to mine 1 NKN ? Screen shot attanched . Thank you . Capture

Thanks you so much, It was easy and Perfect Instruction, can you please share some use-full commands to run on server to check etc etc

More nodes the bigger the chance. Also there are so many new nodes now, so we get less rewards.

A week not bad, somebody said that it is 1 block = 11 NKN per 3 weeks, unless you get lucky.

Keep deploying more of them on sites like Linode, Digital Ocean, Vultr… you can also find 100$ credits here: https://vpstrial.net/vps/

to check what?

if it’s running fine, or check wallet balance and node info ?
I have added already wallet on NKNx website and Server ip to , i can see there to info but what if i want to see directly in Terminal ?

nstatus.org is easy to check the status any node.

in terminal try this one:
cd "$(sudo find / -type d -name "nkn-node")"; ./nknc info -s
I just made it :smiley: dunno any more

glances aka task manager
vnstat to look at daily / monthly internet usage

1 Like