Set up a public node on a VPS

From Nxtwiki
Jump to: navigation, search

Setting up a public Nxt node on a VPS or dedicated server

NOTE: this is an advanced operation, and is not a suitable activity for people who are uncomfortable with Linux, networking concepts, or command-line interfaces. Following these steps implies that you are willing to pay a monthly fee to a service provider who will host your Nxt node. If you do not know what an IP address is or do not know how to use a command-line text editor, this is probably not for you. Read all of these instructions and make sure you understand them before you decide to proceed. You can still contribute to the network by running Nxt on your local computer.

  1. Sign up for a VPS (Virtual Private Server) with a provider like digitalocean.com. These instructions assume you are using DigitalOcean, but other providers are similar and offer their own "help" documentation for setting up a server.
  2. Once signed up you can fund your account
    • $5 covers 1 month of computing for 1 server, with a small amount of storage and RAM. This is sufficient, but not ideal
    • the $10 monthly plan, with 1 GB RAM VPS, is better and more stable
  3. Create your first droplet
    1. Set the hostname to whatever you like
    2. Select thee $5 or $10 a month option
    3. Select "Debian 7.0 x64" which is Debian under the Linux Distributions tab

Once created, you will receive an email with the IP address, username (should be 'root'), and password. You are now ready to connect to your new server, and set up Nxt.

  1. If you are on Windows, download Putty ( http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ) and use it to connect to your VPS.
    • If you are on a Mac, you can use your Terminal application, which is built in to MacOS
    • If you are on any UNIX system, you can use any shell
  2. Connect to your VPS
    1. If you are using putty, open it. Input the IP Address from the email into the Host Name field and select open.
    2. If you are using Terminal or a UNIX shell, use ssh to connect to your server by typing ssh {IPAddress}, where {IPAddress} is the address of your VPS
  3. Input the commands to setup your server
    • NOTE 1: These steps will set up your Nxt node to run as 'root'. This is risky, since anyone who compromises this account will get full access to your VPS. It is better to set up a separate user account to run your Nxt node. Setting up a user account is outside the scope of this How-To... but if you do not know how to set up a user account, this whole thing may be a Bad Idea for you.
    • NOTE 2: These steps make reference to a download link for the NRS software. The current version is 1.12.2, and is available from https://www.jelurida.com/nxt-client.zip. You can verify that the software is authentic by checking its SHA256 hash value, which is
      d5d48729a1f32b8c11066bcdb203dd7760a582896afe8d2506feb93cf833f606 nxt-client-1.12.1.zip

(source: Jelurida Release) - How to verify SHA256 checksums.

    1. The first step is to login. Just enter the username from the email (most likely root). Then enter (or copy and paste). Now you're ready to run these commands:
      1. sudo apt-get update
      2. sudo apt-get install openjdk-8-jre nano (If openjdk-8 is not available on Debian, get it here: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html)
      3. wget https://www.jelurida.com/nxt-client.zip
      4. unzip nxt.zip
        • NOTE: The exact filename may not be nxt.zip, depending on the version. The filename is the same as in the download link.
      5. pico nxt/conf/nxt-default.properties
        • "pico" is the name of a text editing utility. If you do not have pico on your system, try "nano".
      6. write these lines, where X.X.X.X is the IP address of the host:
        • nxt.myAddress=X.X.X.X
        • nxt.allowedBotHosts=127.0.0.1; localhost; X.X.X.X; 0:0:0:0:0:0:0:1;
        • nxt.allowedUserHosts=127.0.0.1; localhost; X.X.X.X; 0:0:0:0:0:0:0:1;
      7. press CTRL+X and then Y to save the file.
      8. cd ~/nxt
      9. nohup ./run.sh &
      10. exit
  1. open http://ipaddress:7876 in your browser to verify NXT is running ok. Your browser will give you a security certificate warning; this is normal. Click confirm to proceed. Your node is up and running!
  2. You should create a hallmark for your node. Read our hallmark FAQ, and then see these instructions.

Additional Tools

These tools have been created by the community and may help you manage your node:

  • http://nxtra.org/nodes/ (for generating a random list of well-known peers you can put in your nxt.properties file)
  • http://www.peerexplorer.com/ provides information and statistics on public servers that are running Nxt
  • nxtcoinbox offers a simple shell script for setting up and deploying a node on a Linux server
  • http://nxt.now.im for automated management of up to thousands of VPSs. Advanced linux/ansible.


Public Node from your home

Running a public server on your home system is similar to running an accessible peer-to-peer node on services such as napster (r.i.p.), emule, bittorrent, bitcoin, etc. So if you want to run a public server at your home (warning, you could potentially see a big traffic utilization happen), then unless you have uPNP on your home router set up, you must open a specific port (7874 for NXT) to incoming TCP traffic on your router and forward it to your computer that runs the NXT java software, and also open the same port on your computer's internal firewall. You also must edit a well-hidden configuration file, nxt/conf/nxt.properties, to insert your home internet connection's public IP address (from, for example, http://myip.dnsomatic.com) as the value of parameter myAddress. And if your IP number changes, you need to re-edit the file. Or if you upgrade the client you will also have to redo these edits to nxt.properties.

Preferably, you should obtain a free dynamic dns domain name from for example http://www.noip.com/free, set up the NOIP automatic update client to run at boot time on your system, and set myAddress to your noip.com name, such as nxtcoin9876.no-ip.org. In all cases, you need to save the nxt.properties file, so that when you upgrade NXT NRS client, you can then copy it back over the default file after unzipping an upgraded client.

Setting up a public node Amazon AWS

Follow these steps to create an Amazon AWS VPS that hosts a Nxt server. Amazon will give you access to a server for free for 1 year, but be aware that there is a cap on network bandwidth. After your server passes this limit, you will be billed for extra data transfer.

Note 1: DO NOT USE THIS VPS FOR REAL MONEY ACCOUNTS!! Use it only for the benefit of putting more nodes on the network.

Note 2: This procedure was originally created by BaiMangal in this Bitcointalk forum post. If it is of value, track him down and send him some Nxt!)

Note 3: This procedure assumes you are running Windows. You can follow these steps if you are another platform, but you may have to modify some things for your environment.

Part 1: Set up a Windows server on Amazon AWS for running Nxt

Follow the steps outlined in each of these screen captures (click each one to see a larger version):

1
AWS STEP1
2
AWS STEP2
3
AWS STEP3
4
AWS STEP4
5
AWS STEP5
6
AWS STEP6
7
AWS STEP7
8
AWS STEP8
9
AWS STEP9
10
AWS STEP91
11
AWS STEP92
12
AWS STEP93
13
AWS STEP94
14
AWS STEP95
15
AWS STEP96
16
AWS STEP97
17
AWS STEP98
18
AWS STEP99

Part 2: Create firewall rules for accessing the server

After you create and connect to the VPS using the remote desktop shortcut, you need to set up Firewall Rules on the Server to allow everything for Nxt. Here are the steps (click each one to see a larger version):

1
AWS VPS1
2
AWS VPS2
3
AWS VPS3
4
AWS VPS4
5
AWS VPS5
6
AWS VPS6
7
AWS VPS7
8
AWS VPS8

Part 3: Configure the client

It is highly suggested to run a client version 0.9.0 or older. The following steps are only valid for versions after the 0.8.0.

  • First, you need to find out the IP of your server. It should be mentioned in the background image once you log in. If it is not, go to the Amazon AWS console and on the top right select the region where you set up your VPS. If you do not know this information simply click all the available options until one of them mentions "1 Volume" under "Resources" in the middle of the page.
  • Download the latest Nxt client. Unzip it. Create an empty file under the folder "conf" and write the following:

# Hosts from which to allow NRS user interface requests, if enabled
nxt.allowedUserHosts=127.0.0.1; localhost; VPS_IP_HERE; 0:0:0:0:0:0:0:1;
make sure you modify VPS_IP_HERE accordingly.

  • Save the file as nxt.properties
  • By default Java is not installed, therefore you should download and install it before running the client.
  • Now you can double-click the run.bat launcher.
  • Make sure you disconnect from your VPS by clicking the "X" of the window, this is the only way to make sure it will keep running remotely. In fact, if you shut down or logout, it will also do that remotely.