…on an Azure VPS from a Windows PC.
In the previous part you learned how to setup your Azure VPS, now let’s continue with the configuration and install the actual node.
Again, big credit to the original set-up guides by BlackTurtle and MapleNode, most of the stuff in this section is coming from them.
We finished of in the last part with the VPS being created on the Azure platform. When it’s done hit the Go to resource button and you’ll see this screen:
This might look a bit daunting at first, but we need just a few settings here.
1. Securing access
First we need to secure access to your VPS. Click on Networking under settings in the left menu bar.
Double click on the line with SSH to edit the settings and change Source to IP Addresses and fill in your own IP address (if you don’t know you can find out with whatsmyip.org).
While we are here we can also add the other firewall rules required for running the node, opening up port 6860 to the public and 6861 for private access. Click on Add inbound port rule and use the following settings:
and click Save. then click Add inbound port rule again for port 6861:
Again, change the source like we did with port 22 and put your own IP address in for Source ip addresses.
You should end up with something like this:
2. Connect to the VPS
ok, finally, we can connect to the VPS 🙂
If you ever forget your public ip, just click on the Connect button on your resource overview in Azure:
Fire up Putty, put in your public IP in the Host Name (or IP address) field and click Open.
Once connected enter your Login credentials.
…and we’re connected to our fresh new Linux environment.
As this is a Azure VM you are not connected as the ‘root’ user, but you you do have root / administrator rights as long as you use the sudo
command.
3. Update Ubuntu
Now that we’re connected we need to update Ubuntu. Run the following commands to update your VPS:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Once the updates finished, restart the VPS with:sudo shutdown -r now
and reconnect again with Putty.
Now with most other how-to’s on running a TN node you would now create a new user. On Azure this isn’t necessary because we already created the user when configuring the VPS, so we can skip that step.
4. Install JAVA
Next we will install Java Runtime Environment 1.8 to run the node software. Run these commands to install the JRE and JDK:
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk
Once completed check your installed version with: java -version
5. Install node software
Next we need to create our working directory where the node software and configuration will be placed:
- Create the directory:
sudo mkdir /opt/turtle
- Change directory:
cd /opt/turtle
Next we’ll need to download the latest stable version of the software.
Go to https://github.com/BlackTurtle123/TurtleNetwork/releases to check what the latest release is, currently that is 0.16.3. You’ll need to remember that version number for the following commands:
- Get the node software:
sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.16.3/TN-all-0.16.3.jar
- Get the .conf file:
sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.16.3/TN-mainnet.conf
If the current version is higher than 0.16.3 just replace 0.16.3 in the above command with the current version number.
Current version is 0.16.6, but this version doesn’t have a separate TN-mainnet.conf file, so you still need to grab the one from version 0.16.3 as shown above.
6. Create a new TN wallet
Now it’s best to start off with a fresh TN wallet for use with your node. Head over to https://client.turtlenetwork.eu and click on new account.
Important: Save your seed (preferably somewhere offline) and don’t loose it or give it out. If you don’t have your seed, you can’t restore your wallet and loose access & anything you have in it.
Put in a name and password (remember it, we need it later on) and click on REGISTER to login.
Now click on the BACKUP icon in the upper right corner and copy the ENCODED SEED, we will also need that for the configuration.
You can logout of your wallet now.
7. Configure node software
Finally we can start configuring the node 🙂
Fire up an editor to start editing the .conf file:
sudo nano TN-mainnet.conf
and change the following lines (remove any starting # on those lines):
- line 19 node-name: replace
My MAINNET node
with your node’s name - line 22 declared-address: replace
1.2.3.4:6868
with your public ip-address followed by:6860
- line 27 password: replace
ridetheTN!
with the password you put in when creating your wallet - line 30 seed: put your encoded seed (the one you copied in the previous section)
- line 52 enable: replace
no
withyes
- line 55 bind-address: replace
127.0.0.1
with0.0.0.0
- line 65 features: replace
supported = [1, 2, 3, 5, 6,7,8]
with
auto-shutdown-on-unsupported-feature = yes
supported = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
8. Start your node
After saving the changes to TN-mainnet.conf it’s time to fire up your node for the first time:
java -jar TN-all-0.16.3.jar TN-mainnet.conf
It will take a while to synchronize all blocks already created. Just let it run until the Blockchain is completely updated.
Check if your node is listed in the peers overview at https://explorer.turtlenetwork.eu/peers – if it’s listed your good to go.
9. Configure REST API
Next we need to configure your REST API, that’s required to being able to access certain feature of your node from external addresses (for instance using my LPOS Distribution setup).
Open your browser and head over to your node’s public IP at port 6861, for instance http://23.97.218.152:6861.
Click on Utils and then /utils/hash/secure. Enter your api key in the Value field and click Try it out!.
Copy the information from Repsonse Body, message is your unhashed api key and hash is your hashed api key. You will need these, so write them down carefully.
Go back to Putty and your terminal session with your node. It’s probably still downloading the blockchain. If you do not want to wait for it to finish before we edit the TN-mainnet.conf again press Ctrl-C, this will gracefully shut down the nodesoftware:
Now we need to add the information for the apikey in TN-mainnet.conf, so let’s edit it again:
sudo nano TN-mainnet.conf
Head to line 61 api-key-hash and change it to the hashed api key we copied above. Save it.
10. Run It!
That’s basically it. Now we can fire up the node software again and it can keep chugging along. To make sure the node software isn’t shut down when you disconnect your Putty session we are going to use tmux, tmux allows a user to run multiple terminal sessions (that stay active) locally or from a remote terminal session.
First we need to install tmux:
sudo apt-get install tmux
And let’s run it:
tmux
and start the node again:
java -jar TN-all-0.16.3.jar TN-mainnet.conf
that’s it, your node is running, congratulations!!!
Next time you connect to your node with putty you can attach to the tmux session with (check here for a small tmux cheatsheet):
tmux attach -t 0
One Reply to “How to run a TN node (part 2)”
[…] The next part is (finally) finished: https://www.mortysnode.nl/how-to-run-a-tn-node-part-2/ […]