Setting up a $TN node

goldenbear7 edited this page Oct 29, 2018 · 17 revisions

Document Approvals
Document Owner: @Black_Turtle on Telegram
Document Creator/Editor: @gordobtel on Telegram

Table of Contents

1. Introduction

2. Hosting

3. Turtle Network Node Setup -- Step 1

4. Turtle Network Node Setup -- Step 2

5. Turtle Network Node Upgrade

6. Other Useful Information

7. Video tutorial

Introduction

The following tutorial will show the full steps in setting-up a Linux Full Node on the Turtle Network.

Note: All access to the VPS server securely done via port 22 (SSH).

Hosting

  1. A Virtual Private Server (VPS) server is required with the following minimum specifications;

Details | Configuration


Operating System; | Ubuntu 16.04
Hosting type | VPS
- CPU 1 CPU vCores
- Memory 2 GB Memory
- Storage 50GB (SSD preferred)
Configuration; | Static IP Required
Access; | Root access required
TurtleNode (TN) required for a node | 1 000 TN

  1. Fully patch the Operating System (OS): Login as 'root' and execute the following commands;
  • sudo apt-get update # Fetches the list of available updates

  • sudo apt-get upgrade # Strictly upgrades the current packages

  • Reboot

  1. Create a local App user with sudo rights (more secure than using root)

    • Issue the following command: adduser *username* (replace username with the required username) & it will prompt to set a password.

    • Add the new username into the sudo group with the following command:

      usermod -aG sudo username (replace username with the required username)

    • logout as root.

Turtle Network Node Setup -- Step 1

Note: All terminal sessions and commands from this point, will be done with the new 'username' created in 2.3.

  1. Install the JRE 1.8 (64-bit version) with the following commands;
-   `sudo add-apt-repository -y ppa:webupd8team/java`

-   `sudo apt-get update`

-   `sudo apt-get -y install oracle-java8-installer`

-   **Note.** Oracle JRE 8 with 64-bit version is required
  1. Check the installation with the following command;

    • java -version and the output should show the below & note that versions might differ;

"java version "1.8.0_74"

Java(TM) SE Runtime Environment (build 1.8.0_74-b02)

Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)"

Turtle Network Node Setup -- Step 2

Note: All terminal sessions and commands from this point, will be done with the new 'username' created in 2.3.

Link: Github: https://github.com/BlackTurtle123/TurtleNetwork/releases

Link: Explorer: https://explorer.blackturtle.eu

Link: Gateway: https://gateway.blackturtle.eu

Link: Wallet: https://turtlenetwork.blackturtle.eu

Link: Learn VI Editor basics: https://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi

  1. Create a working directory; mkdir /opt/turtle

  2. Work from this directory: cd /opt/turtle

  3. Get the required files & configuration;

    • sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.13.6/TN-all-0.13.6.jar (replace *0.13.6.jar with the latest .jar version, currently last version, date 10/06/2018)

    • sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.10.8/TN-mainnet.conf (replace *0.10.8 with the latest version, currently last version, date 10/06/2018)

  4. Create a wallet on the Turtle Network;

    • https://turtlenetwork.blackturtle.eu then create 'New Account'

    • Important: Save your SEED & password securely and never loose.

    • Login to your wallet and record the following;

      • Wallet Address:

      • Wallet Password:

      • In Wallet, navigate to the 'Backup' item in the top-right section, click, then record your 'ENCODED SEED' which will be used later.

      • Logout of wallet

  5. Edit the TN-mainnet.conf file in /opt/turtle;

    • vi /opt/turtle/TN-mainnet.conf

    • Change the following defaults;

      • # P2P Network settings section;

        • remove the '#' then change: node-name = "My MAINNET node" --> change to your custom node name

        • remove the '#' then change: declared-address = "1.2.3.4:6868" --> change to 'yourstaticip:6860

      • # Wallet settings section;

        • change: password = "ridetheTN!" to your wallet password set in section 4.

        • remove the '#' then change seed = "" to your ENCODED SEED noted in section 4.

  6. Start your node from /opt/turtle directory: java -jar TN-all-0.10.10.jar TN-mainnet.conf & let the blockchain download fully.
    PS: you can run the java command in a tmux (http://manpages.ubuntu.com/manpages/xenial/man1/tmux.1.html) or screen (https://help.ubuntu.com/community/Screen) session.

  7. Browse to https://explorer.blackturtle.eu/peers & confirm your node is listed.

  8. Edit the TN-mainnet.conf file in /opt/turtle;

    • # Node's REST API settings section;

      • enable = no --> change to 'yes'

      • bind-address = "127.0.0.1" --> change to 0.0.0.0

      • Restart your node

  9. Open http://yourserverip:6861 and can access Swagger to do the following;

    • Encrypt your API key, do the following;

      • Click on 'Utils' then "/utils/hash/secure"

      • Insert your own 'custom api key' in the 'Value' section then click 'Try it Out'

      • Record your 'custom api key' and the 'hash' value which was generated by the previous command

  10. Edit the TN-mainnet.conf file in /opt/turtle;

    • # Node's REST API settings section;

      • api-key-hash = "H6nsiifwYKYEx6YzYD7woP1XCn72RVvx6tC1zjjLXqsu" --> replace with your own hash key noted in section 4.9.

      • bind-address = "0.0.0.0" --> change to 127.0.0.1 (meaning you can only access http://yourserverip:6861 from your own server

      • Restart your node

      • Note: Access from your own server in console: curl -i http://localhost:6861

  11. Implement a Firewall using iptables (extra security).

    • Insert the below data into an executable file called TN_firewall for ease-of-use, basic configuration below;
    • Create file: sudo touch TN_firewall
    • Execute using: sudo ./TN_firewall

#!/bin/sh
######################################
echo "*** Turtle Network Firewall ***"
######################################
#
###################
# Setting variables
###################
#
# Checking for iptables
#######################
IPTABLES=/sbin/iptables
#######################
#
echo "Checking for IPTABLES"

if ! [ -x $IPTABLES ] ; then
        echo
        echo "ERROR IN CONFIGURATION: IPTABLES doesn't exist or isn't executable!"
        exit 1
fi
#
#####################
echo "FLUSHING RULES"
#####################
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -P OUTPUT ACCEPT

#######################
echo "INPUT CHAIN... "
#######################
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 6860 -j ACCEPT
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A INPUT -j DROP

###############################################
echo "*** Turtle Network Firewall Complete ***"
###############################################

Note: Port 80 uses a proxy to forward to port 6861

Turtle Network Node Upgrade

Note: All terminal sessions and commands from this point, will be done with the new 'username' created in 2.3.

  1. Work from this directory: cd /opt/turtle;

  2. Backup your current TN-mainnet.conf and .jar file: cp TN-mainnet.conf TN-mainnet.conf.backup & do the same with the jar file

  3. Get the updated files & configuration (Latest releases: https://github.com/BlackTurtle123/TurtleNetwork/releases)

    • sudo wget https://github.com/BlackTurtle123/Waves/releases/download/v0.13.6/TN-all-0.13.6.jar (replace *0.13.6.jar with the latest .jar version)

    • sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.13.6/TN-mainnet.conf (replace *0.13.6 with the latest version)

      • Note. Best to manually review for the changes in the TN-mainnet.conf than overwriting, as you would need to redo your custom settings
  4. Stop the node

    • jps -l (list java processes)

    • kill -9 PID (replace PID with your the required process number)

  5. Start the node with the new configuration files: java -jar TN-all-0.13.6.jar TN-mainnet.conf (replace TN-all-0.13.6.jar with the latest downloaded version)

Other Useful Information

  1. Review the node log: tail -f /home/youruser/TN/log/TN.log (replace 'youruser')
  2. Check if node has forged any blocks: grep Forged and applied Block /home/youruser/TN/log/TN.log (replace 'youruser')
  3. Turtle Node Reporting: http://statistics.blackturtle.eu/nodes

Video

Tutorial on node setup

Persetujuan dokumen
Pemilik dokumen: @Black_Turtle on Telegram
Dokument Creator: @gordobtel on Telegram

Isi tabel

1. Pengenalan

2. Sebagai tuan Rumah

3. Membangun Turtle Network Node -- Langkah 1

4. Membangun Turtle Network Node-- langkah 2

5. meng-upgrade Turtle Network Node

6. Keterangan lain yang berguna

7. Video tutorial

Pengenalan

Tutorial berikut ini akan menunjukkan seluruh langkah dalam membangun sebuah Simpul Linux di Turtle Network. Catatan : Semua akses ke VPS lebih aman dilakukan melalui port 22 (SSH).

Hosting

  1. Sebuah server VPS dibutuhkan dengan spesifikasi minimal sebagai berikut;

Details | Konfigurasi


Sistem operasi; | Ubuntu 16.04
Hosting type | VPS
- CPU 1 CPU vCores
- Memory 2 GB Memory
- Storage 50GB (SSD preferred)
Konfigurasi; | IP statis dibutuhkan
Akses; | akses akar dibutuhkan
Dibutuhkan TurtleNode (TN) untuk sebuah** | 1 000 TN

  1. Penuhi tambalan Sistem Operasi: Masuk sebagai 'root' dan eksekusi perintah berikut;
  • sudo apt-get update # Jemput daftar terkini yang diberikan

  • sudo apt-get upgrade # Segera tingkatkan paket yg sedang berjalan

  • Reboot

  1. Ciptakan sebuah aplikasi lokal dengan menggunakan sudo, lebih aman daripada menggunakan Root)

    • Buat perintah berikut : adduser username ( ganti username dengan username yg dibutuhkan) & akan mengeset password yg benar.

    • Tambahkan username yg baru kedalam group sudo dengan perintah berikut : usermod -aG sudo username, ganti username dengan username yg dibutuhkan:

      usermod -aG sudo username (replace username with the required username)

    • Keluar sebagai root.

Membangun Simpul Turtle Network -- Langkah 1

Ingat* : Semua sesi terminal dan perintah dari tahap ini, akan dilakukan dengan 'username' yg dibuat di langkah 2.3.

  1. Pasang JRE 1.8 (version 64 bit) dengan perintah berikut;
-   `sudo add-apt-repository -y ppa:webupd8team/java`

-   `sudo apt-get update`

-   `sudo apt-get -y install oracle-java8-installer`

-   **Note.** Oracle JRE 8 with 64-bit version is required
  1. Check the installation with the following command;

    • `version Java dan hasilnya harus menunjukkan seperti yg dibawah in dan perhatikan bahwa versinya bisa berbeda;

"java version "1.8.0_74"

Java(TM) SE Runtime Environment (build 1.8.0_74-b02)

Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)"

Membangun sebuah Simpul Turtle Network-- Langkah 2

**Catatan: Semua sesi terminal dan perintah dari tahap in, akan dijalankan dengan'username' yg baru di buat di 2.3..

Link: Github: https://github.com/BlackTurtle123/TurtleNetwork/releases

Link: Explorer: https://explorer.blackturtle.eu

Link: Gateway: https://gateway.blackturtle.eu

Link: Wallet: https://turtlenetwork.blackturtle.eu

Link: Learn VI Editor basics: https://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi

  1. Ciptakan sebuah penuntun kerja; mkdir /opt/turtle

  2. kerjakan sesuai dengan penuntun ini: cd /opt/turtle

  3. Dapatkan file dan konfigurasi yg dibutuhkan;

    • sudo wget https://github.com/BlackTurtle123/Waves/releases/download/v0.10.10/TN-all-0.10.10.jar (replace *0.10.10.jar with the latest .jar version, currently last version, date 10/06/2018)

    • sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.10.8/TN-mainnet.conf (replace *0.10.8 with the latest version, currently last version, date 10/06/2018)

  4. Ciptakan sebuah dompet di Turtle Network;

    • https://turtlenetwork.blackturtle.eu buat sebuah ' Akun Baru'

    • Penting : Simpan SEED dan password and dan jangan pernah hilang.

    • Login ke dompet dan catat yg berikut ini;

      • alamat dompet:

      • Sandi dompet:

      • Di dalam Wallet, geser ke 'Backup' di bagian sisi atas kanan, klik, kemudian catat ENCODED SEED yg akan di pergunakan nanti..

      • Keluar dari Wallet

  5. Edit the TN-mainnet.conf file in /opt/turtle;

    • vi /opt/turtle/TN-mainnet.conf

    • Ubah aturan berikut;

      • # Bagian setting jaringan P2P;

        • hapus '#', kemudian ubah nama nodenya ---> ubah menjadi nama node yg di inginkan

        • hapus '#', kemudian ubah: alamat deklarasi = "1.2.3.4:6868"--->ubah ke IP statis:6860

      • # Bagian setting dompet;

        • Ubah kata sandi= ride the TN menjadi kata sandi dompet anda yg di buat di bagian 4.

        • Hapus '#' kemudian ubah seed ke ENCODED SEED anda yg tercatat di bagian 4.

  6. Start your node from /opt/turtle directory: java -jar TN-all-0.10.10.jar TN-mainnet.conf & let the blockchain download fully.
    PS: you can run the java command in a tmux (http://manpages.ubuntu.com/manpages/xenial/man1/tmux.1.html) or screen (https://help.ubuntu.com/community/Screen) session.

  7. Telusuri https://explorer.blackturtle.eu/peers & confirm your node is listed.

  8. Edit jaringan utama TN. File Konfigurasi di/opt/turtle;

    • Bagian setting #Node's REST API;

      • Aktifkan = tidak --> ubah ke 'ya'

      • bind-address = "127.0.0.1" --> change to 0.0.0.0

      • Start ulang node anda

  9. Buka http://ipserveranda:6861 dan bisa mengakses Swagger untuk mengerjakan yg berikut;

    -   Enkripsikan kunci API anda, dengan lakukan seperti berikut;
    
    -   Click on 'Utils' then \"/utils/hash/secure\"
    
    -   Masukkan 'kunci API khusus' anda sendiri di bagian 'Value' kemudian klik 'Try it Out'  
    
    -   Catat 'kunci api khusus' anda dan nilai 'hash' yang dihasilkan oleh perintah sebelumnya
    
  10. Sunting konfigurasi jaringan utama TN di dalam /opt/turtle;

    • bagian setting Node REST API;

      • api-key-hash = "H6nsiifwYKYEx6YzYD7woP1XCn72RVvx6tC1zjjLXqsu" --> gantikan dengan kunci hash anda sendiri yg tercatat di bagian 4.9.

      • ikat-alamat = 0.0.0.0 --> ubah menjadi 127.0.0.1 tujuannya anda hanya bisa mengakses http://ipserveranda:6861 dari server anda pribadi

      • Start ulang node anda

      • **Perhatikan: Akses server anda pribadi dengan konsol): curl -i http://localhost:6861

  11. Jalankan Firewall dengan menggunakan tabel IP, (pengamanan extra).

    • Masukkan data dibawah kedalam sebuah file yg akan di eksekusi dengan panggilan TN_firewall supaya mudah digunakan, konfigurasi dasar berikut;
    • Ciptakan file: sudo touch TN_firewall
    • Eksekusi gunakan: sudo ./TN_firewall

#!/bin/sh
######################################
echo "*** Turtle Network Firewall ***"
######################################
#
###################
# Setting variables
###################
#
# Checking for iptables
#######################
IPTABLES=/sbin/iptables
#######################
#
echo "Checking for IPTABLES"

if ! [ -x $IPTABLES ] ; then
        echo
        echo "ERROR IN CONFIGURATION: IPTABLES doesn't exist or isn't executable!"
        exit 1
fi
#
#####################
echo "FLUSHING RULES"
#####################
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -P OUTPUT ACCEPT

#######################
echo "INPUT CHAIN... "
#######################
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 6860 -j ACCEPT
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A INPUT -j DROP

###############################################
echo "*** Turtle Network Firewall Complete ***"
###############################################

Catatan: Port 80 menggunakan proxy untuk meneruskan ke port 6861

Meng-upgrade Node Turtle Network

Catatan: Semua bagian terminal dan perintah dari tahap ini, akan di jalankan dengan 'username' yg baru, dibuat di langkah 2.3.

  1. Kerjakan dari direktori ini: cd/ opt/turtle`;

  2. Dukung konfigurasi jaringan utama TN anda yg sekarang dan file jar : cp TN-mainnet.conf Tn-mainnet konfigurasi.backup dan kerjakan hal yg sama dengan file jar

  3. Dapatkan files dan konfigurasi terkini ( Rilis terkini : https://github.com/BlackTurtle123/TurtleNetwork/releases)

    • sudo wget https://github.com/BlackTurtle123/Waves/releases/download/v0.13.6/TN-all-0.13.6.jar (replace *0.13.6.jar with the latest .jar version)

    • sudo wget https://github.com/BlackTurtle123/TurtleNetwork/releases/download/v0.13.6/TN-mainnet.conf (replace *0.13.6 with the latest version)

      • Catatan. Terbaik adalah dengan memeriksa ulang perubahan di konfigurasi jaringan utama TN daripada menimpa saat anda perlu untuk mengerjakan ulang pengaturan khusus'
  4. Menghentikan node

    • jps -l (proses daftar java)

    • kill -9 PID (gantikan PID dengan nomor proses yg dibutuhkan)

  5. Mulailah node dengan konfigurasi file baru: Java -jar TN -all- 0.13.6.jar konfigurasi jaringan utama TN ( gantikan TN-all-0.13.6.jar dengan unduh versi yg terkini)

Informasi Lain yg Berguna

  1. Periksa ulang log node: tail -f /home/youruser/TN/log/TN.log (ganti 'youruser')
  2. Periksa apakah node sudah menempa blok lain dan gunakan Block/home/youruser/TN/log/TN.log(ganti 'youruser:)
  3. laporan Turtle Node: http://statistics.blackturtle.eu/nodes

Video

Tutorial on node setup

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.