elective-stereophonic
elective-stereophonic
[Raspberry Pi] Latest Nxt Client and english tutorial
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.11.15 | Latest Experimental Nxt Client: Nxt 1.12.0e

Author Topic: [Raspberry Pi] Latest Nxt Client and english tutorial  (Read 9884 times)

JackCelere

  • Hero Member
  • *****
  • Karma: +50/-0
  • Offline Offline
  • Posts: 539
    • View Profile
[Raspberry Pi] Latest Nxt Client and english tutorial
« on: July 03, 2014, 04:15:34 pm »

Latest update 26/06/2015

Hi there!

I recently wrote a tutorial (in French) about how to use your RasPi for NXT forging as a node. Since the only english tutorial is outdated, even if my English is not that good, I'll try to make a new one.

How to use your RasPi for NXT forging as a node?

(If you already have a working RasPi, you can skip to the 4th part.)


I. RasPi, watizit?

Whatever farmers hoped, we don't aim to plant raspberries for the NxtVillage project. Along with Apple, this fruit name refers to a single-board computer running GNU/Linux.

This credit card sized computer measures about 8.5 x 5.5 x 1.5 cm, has two hardware models of which the most upscale one has 512 MB RAM, a 700 MHz processor and a comprehensive connectivity (HDMI, 2 x USB, RJ45, RCA, Jack - I'm so famous  ;D), at a price about €30.


II. Why do I need a RasPi?

I'm sure that some wonder why they need a Raspberry Pi while they already have another best performing PC. The operative word here is security. Indeed, your personnal computer is vulnerable to viruses, spywares, rootkits, etc. Why? Because you probably use windows, you navigate the internet, you install additional softwares, etc. Actually, the best way is to use another computer runing GNU/Linux for NXT forging as a node and only for that. A Raspberry Pi prevent you from falling into ruin at a price about €, for a very low energy consumption, and can handle up to 500 transactions/second.

In reality, you'll need to buy additionnal accessories. You can follow this guide so that you don't forget anything.

For information, here are the components I choosed: Raspberry Pi B & 2.8" TFT screen + case adapted & Dongle Edimax & SD card class 10 95MB/s & 5V supply Aukru. Incidentally, you will need a soldering iron, a < 1 mm tin wire and a TV or a computer screen to configure your TFT screen.

III. How to configure your RasPi?

Now you need to choose and to install an operating system. You can choose from all the GNU/Linux distributions, from Debian to OpenSUSE though Raspbian, which is certainly the most appropriate for your RasPi. Here is a good tutorial: https://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian. If you bought a TFT screen, it is necessary to install it. Here is the installation tutorial for the 2.8" TFT screen from Adafruit: https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/software-installation.

If you have any question, don't hesitate to ask.

IV. How to run Nxt?

Assuming that everything works fine, let's download, run and configure Nxt software.

0 - Configuring a static IP

Edit "/etc/network/interfaces" with nano and change "iface eth0 inet dhcp" entry to the following ones:
Code: [Select]
sudo nano /etc/network/interfaces
Code: [Select]
iface eth0 inet static      #ip statique
address 192.168.1.5       #adresse du Raspi
netmask 255.255.255.0   
gateway 192.168.1.1      #adresse de la box
network 192.168.1.0       
broadcast 192.168.1.255

1 - Java installation

1.1 - Update the package list:
Code: [Select]
sudo apt-get update
1.2 - Install Java:
Code: [Select]
sudo apt-get install openjdk-8-jdk
1.3 - Ensure the system uses the latest version of Java:
Code: [Select]
sudo update-alternatives --config javaIf the command returns a list, choose JDK 8 and uninstall the outdated version:

Code: [Select]
sudo apt-get purge openjdk-7-jre
2 - Downloading nxt-client-1.1.6.zip

2.1 - Download the archive file:
Code: [Select]
wget https://bitbucket.org/JeanLucPicard/nxt/downloads/nxt-client-1.1.6.zip
2.2 - Verify the SHA-256 checksum match with the following command:
SHA-256: 66c27b3f8af051effafdf976fb54a6e25a19be3fdd050f3fecab0f55df2f2c3f (nxt-client-1.1.6.zip)

Code: [Select]
sha256sum nxt-client-1.1.6.zip
2.3 - Unzip it:
Code: [Select]
unzip nxt-client-1.1.6.zip -d folder_location
3 - Opening up of 7874, 7875 and 7876 ports
Code: [Select]
iptables -I INPUT -p tcp --dport 7874 -j ACCEPT
Code: [Select]
iptables -I INPUT -p tcp --dport 7875 -j ACCEPT
Code: [Select]
iptables -I INPUT -p tcp --dport 7876 -j ACCEPT
4 - Creation of a SSL certificate

4.1 - Type the following commands and choose a password when asked:
Code: [Select]
cd path_to_the_nxt_folder/conf
Code: [Select]
chmod 400 privkey.pem
chmod 400 mycert.crt
openssl pkcs12 -export -inkey privkey.pem -in mycert.crt -out mycert.pkcs12
chmod 400 mycert.pkcs12
keytool -importkeystore -srckeystore mycert.pkcs12 -srcstoretype PKCS12 -destkeystore keystore

4.2 - Edit "path_to_the_nxt_folder/conf/nxt.properties" with nano and replace the values on several points with the following:
Code: [Select]
sudo nano path_to_the_nxt_folder/nxt.properties
Code: [Select]
nxt.uiSSL=true
Code: [Select]
nxt.apiSSL=true
Code: [Select]
nxt.keyStorePassword=your_pwd
Code: [Select]
nxt.keyStorePath=path_to_the_nxt_folder/conf/keystore
5 - Adding an autorun script for the NRS client

5.1 - Edit run.sh file in the Nxt folder and insert the following:
Code: [Select]
java -cp nxt.jar:lib/*:conf nxt.Nxt STOP.PORT=11111 STOP.KEY=123456
5.2 - Edit cron, insert "@reboot cd path_to_the_nxt_folder && sudo bash run.sh" and save (ctrl + o, enter, ctrl + x):
Code: [Select]
crontab -e
Code: [Select]
@reboot cd path_to_the_nxt_folder && sudo bash run.sh
6 - Adding a stop script for NRS client

6.1 - Make a new file in the nxt folder and name it stop.sh, then insert the following and save (ctrl + o, enter, ctrl + x):
Code: [Select]
cd path_to_the_nxt_folder
Code: [Select]
nano stop.sh
Code: [Select]
java -jar nxt.jar STOP.PORT=11111 STOP.KEY=123456 --stopPORT and KEY values must be the same as defined in step 4.

6.2 - Make a new file in "/etc/rc0.d" and "/etc/rc6.d" and name it autostop.sh, then insert the following and save (ctrl + o, enter, ctrl + x):
Code: [Select]
nano /etc/rc0.d/autostop.sh
Code: [Select]
bash path_to_the_nxt_folder/stop.sh
Code: [Select]
nano /etc/rc6.d/autostop.sh
Code: [Select]
bash ath_to_the_nxt_folder/stop.sh
6.3 - Make the two scripts executable:
Code: [Select]
sudo chmod +x /etc/rc0.d/autostop.sh
Code: [Select]
sudo chmod +x /etc/rc6.d/autostop.sh
Reboot the computer.

7 - Creating a new Nxt wallet

7.1 - Once the Nxt server has started completely (as indicated by the text "Nxt Server v1.1.6 has started successfully") open the page localhost:7876 with your favoured browser, I would adwise you to use IceCat (skip the security certificate by clicking on "Proceed anyway" if needed.)


7.2 - Even if you already have an account, create a new by clicking on the green New? Create Your Account! button.

7.3 - The Nxt Client will generate automatically a strong secret phrase for you, made with 12 random words. You will see it inside of the text box.


If you want to use the passphrase generated by the software, write it down, copy it to a safe place or memorize it (this is very important, since only this passphrase will give you access to your newly created account! You will not be able to change it afterward, your passphrase is your account.) Once you have copied your secret passphrase, press Next.

If you want to use your own passphrase, be careful and make sure you are picking a strong, secure passphrase. Create a passphrase composed by a minimum of 70 characters (uppercase and lowercase letters, numbers and special characters), or at least 12 random words. Once you have generated a secure passphrase, introduce it in the text field inside of the Create your account page, replacing the passphrase generated by the client, and click Next. Record your passphrase, and keep it in a secure location. Never ever use a short passphrase, or a passphrase that someone might use too, or your funds will be stolen - everyone who uses the same passphrase has access to the same account!

We recommend Keepass as a password manager.

In the next page, you'll have to introduce again your secret passphrase to make sure you got it properly saved. Once you have introduced it, click Next.


Congratulations! You will be presented now with the Nxt Client Interface. Your account address (the string starting with NXT- ) appears in the upper left corner of the Nxt Client window.


You are currently forging. Verify the last block is loaded and then you can even close your browser.

Note: Until you make a transaction from your account, it will be protected only by 64-bit entropy. As soon as one outgoing transaction is made your account will receive a public key and it will be protected by 256-bit entropy, much more secure. As a result, we recommend issuing a transaction (by sending NXT, registering an alias, or sending a message) as soon as possible after NXT are deposited into your account for the first time.

8 - Configuring the server and enabling you to connect with your browser from another pc instead of localhost

8.1 - Open the page localhost:7876/admin with your browser and complete the following details:

Code: [Select]
Public IP: y.y.y.y #replace y.y.y.y with the static IP of your Raspberry Pi
Code: [Select]
Date: y-m-d #type the date
Code: [Select]
Secret phrase: your_secret_passphrase

8.2 - Copy your hallmark

8.3 - Edit the "path_to_the_nxt_folder/conf/nxt.properties" file and replace the default values on several points with the following (replace x.x.x.x with the IP adress of the terminal from which you want to connect with your RasPi):
Code: [Select]
sudo nano path_to_the_nxt_folder/conf/nxt.properties
PEER NETWORKING section:
Code: [Select]
nxt.myPlatform=RaspberryPi
Code: [Select]
nxt.myAddress=y.y.y.y
Code: [Select]
nxt.peerServerHost=0.0.0.0 #Allowing all interfaces to connect with the RasPi
Code: [Select]
nxt.myHallmark=your_Hallmark
API SERVER section:
Code: [Select]
nxt.enableAPIServer=true
Code: [Select]
nxt.allowedBotHosts=127.0.0.1; localhost; 0:0:0:0:0:0:0:1; x.x.x.x;
Code: [Select]
nxt.apiServerHost=0.0.0.0
NRS USER INTERFACE section:
Code: [Select]
nxt.enableUIServer=true
Code: [Select]
nxt.allowedUserHosts=127.0.0.1; localhost; 0:0:0:0:0:0:0:1; x.x.x.x;
Code: [Select]
nxt.uiServerHost=0.0.0.0
V. To know

  • Visualizing NRS logs in real time:
Code: [Select]
tail -f path_to_the_nxt_folder/nxt.log
If you have this tutorial, feel free to make a small donation to the French community fund @frenchfund or to lezin @5850890848291909083.

Thanks asham, lezin and nanardz. Thanks Ludom and POPPP for the RPi!

I hope someone will rectify my English and put things right if there is some errors.

Thanks for supporting Nxt!
« Last Edit: June 26, 2015, 07:59:51 pm by JackCelere »
Logged

zuqka

  • Sr. Member
  • ****
  • Karma: +32/-4
  • Offline Offline
  • Posts: 328
    • View Profile
    • nxt.zuqka.info
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #1 on: July 03, 2014, 08:52:12 pm »

Great Tut, kudos m8!
Logged
NXT-2V7G-C8BY-KTYY-CAHNU. Sponsoring 4 Full Nxt Nodes & demo.ardorplatform.org

digicoiner

  • Jr. Member
  • **
  • Karma: +4/-0
  • Offline Offline
  • Posts: 57
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #2 on: August 11, 2014, 12:41:23 am »

will NRS version 1.2.3 run successfully on the RPi?
Logged

grewalsatinder

  • Hero Member
  • *****
  • Karma: +89/-3
  • Offline Offline
  • Posts: 527
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #3 on: June 04, 2015, 10:04:04 pm »

Here's my Rasbian Build of NXT node:
https://nxtforum.org/general/can-raspberry-pi-run-as-a-node/msg182014/#msg182014

I haven't used all security tips from this thread. Just made it ready for early experiment.

In next update I'll try to have more security update in my build. Thanks to your guide! :)

Cheers,
Satinder
Logged
NXT-QK5L-7YM9-YPVF-55GL5 - Twitter: https://twitter.com/satindergrewal

Tosch110

  • Hero Member
  • *****
  • Karma: +211/-18
  • Offline Offline
  • Posts: 2365
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #4 on: June 05, 2015, 04:37:44 pm »

Very nice! Thank you for sharing this :)

One little detail, for the new Nxt versions, Java 8 is required.

so instead

Code: [Select]
sudo apt-get install openjdk-7-jre
I think it would need to be this:

Code: [Select]
sudo apt-get install openjdk-8-jdk
I am not sure if the Java 8 JRE is already out, if it is, you can choose the correct install method ;)
Thanks!

JackCelere

  • Hero Member
  • *****
  • Karma: +50/-0
  • Offline Offline
  • Posts: 539
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #5 on: June 26, 2015, 08:10:32 pm »

Here's my Rasbian Build of NXT node:
https://nxtforum.org/general/can-raspberry-pi-run-as-a-node/msg182014/#msg182014
I haven't used all security tips from this thread. Just made it ready for early experiment.
In next update I'll try to have more security update in my build. Thanks to your guide! :)
Cheers,
Satinder
Great! I will test it by next week since I had to format my Pi SD card. By the way I wanted to write a tutorial about using Nxt on Whonix if possible but didn't even manage to install Whonix.  ;D

Very nice! Thank you for sharing this :)
One little detail, for the new Nxt versions, Java 8 is required.
so instead
Code: [Select]
sudo apt-get install openjdk-7-jreI think it would need to be this:
Code: [Select]
sudo apt-get install openjdk-8-jdk
Done, thank you.  ;)
Logged

strimbello

  • Jr. Member
  • **
  • Karma: +5/-1
  • Offline Offline
  • Posts: 93
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #6 on: January 09, 2016, 01:10:48 pm »

These instructions don't work for 1.7.4  - how can you generate the keys there? The dir structure is changed ... I'm lost here.
Logged
NXT: NXT-N5DC-4YK8-3SWK-DARY5
BTC: 345v1cJ8X2x2UYiXVETE9GSeRn4nrW9rPH
Bitmsg: BM-2cVpibgdLwThnHRQkUr5cBpFdJVMUHQbit

yassin54

  • Hero Member
  • *****
  • Karma: +240/-14
  • Offline Offline
  • Posts: 2503
  • I am Homer, Sorry my english is Bad!!
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #7 on: January 09, 2016, 01:12:35 pm »

These instructions don't work for 1.7.4  - how can you generate the keys there? The dir structure is changed ... I'm lost here.
Maybe this? https://nxtportal.org/blog/nxt-in-a-box-rpi2.html  ::) ;)

strimbello

  • Jr. Member
  • **
  • Karma: +5/-1
  • Offline Offline
  • Posts: 93
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #8 on: January 09, 2016, 01:42:44 pm »

Thanks for this link... I got a little bit further now :) 
Logged
NXT: NXT-N5DC-4YK8-3SWK-DARY5
BTC: 345v1cJ8X2x2UYiXVETE9GSeRn4nrW9rPH
Bitmsg: BM-2cVpibgdLwThnHRQkUr5cBpFdJVMUHQbit

yassin54

  • Hero Member
  • *****
  • Karma: +240/-14
  • Offline Offline
  • Posts: 2503
  • I am Homer, Sorry my english is Bad!!
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #9 on: January 09, 2016, 01:52:53 pm »

Thanks for this link... I got a little bit further now :)
A pleasure!!  ;)

strimbello

  • Jr. Member
  • **
  • Karma: +5/-1
  • Offline Offline
  • Posts: 93
    • View Profile
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #10 on: January 09, 2016, 05:47:39 pm »

Hm still stuck.  The blockchain is downloaded (got it from my previous server) and now all the NXt node does is telling me there are "too many outbound connections"
Also, the addresses I log into through the web interface return an error "your address is not found" while that address is in the nxt explorer and holds funds for over a year now.
connection is fine, but it won't let me really use it on the raspberry 2 for the moment.

I wish there was some more in-depth clear tutorial or something... I rarely use linux and such, I don't like the commands and the endless stream of compiling and stuff. Same for Monero or bitcoin, as soon as you hear the word linux, the guides and instructions lead to days and days of trial and error things... it never works.

I give up for now. Maybe next week,... 
getting an NXT node running on a RPI is not easy.
thx for the help, this forum at least triest to help the users, unlike some others where you get laughed at and dumped for even trying to use their system.
Logged
NXT: NXT-N5DC-4YK8-3SWK-DARY5
BTC: 345v1cJ8X2x2UYiXVETE9GSeRn4nrW9rPH
Bitmsg: BM-2cVpibgdLwThnHRQkUr5cBpFdJVMUHQbit

RocketBunny

  • Jr. Member
  • **
  • Karma: +5/-2
  • Offline Offline
  • Posts: 65
  • Big engines fan
    • View Profile
    • Stocks.exchange - where real business meet with crypto world
Re: [Raspberry Pi] Latest Nxt Client and english tutorial
« Reply #11 on: January 09, 2016, 08:35:58 pm »

strimbello
Your address from signature looks good in blockexplorer
Also if you need I can help with RPI, just pm me
Logged
NXT: Vadym
https://stocks.exchange
mailto: vk@stocks.exchange
 

elective-stereophonic
elective-stereophonic
assembly
assembly