How-To:InstallNRSRaspberryPi
Contents
- 1 Installing Nxt (and the NRS client) on Raspberry Pi
- 1.1 Basic Raspbian install guide
- 1.2 Update the system
- 1.3 Install XRDP (RDP server)
- 1.4 Router/firewall port forwarding
- 1.5 Install NXT Client
- 1.6 Stop script for the Nxt software
- 1.7 Connecting from your PC instead of localhost
- 1.8 Manually start forging with the NRS client
- 1.9 Handling NRS and Java errors
- 1.10 Having issues?
- 1.11 Additional useful commands and tools
Installing Nxt (and the NRS client) on Raspberry Pi
(Originally created by barbarosinciler at nextcoin.org . If this is of value to you, please donate some Nxt to him at address 7121642459245273749. The Java package that installs Nxt on your Pi was written by davethetrousers, at 14923118471272229432)
Raspbian and the NRS client for Nxt both run very well on a Raspberry Pi. CPU usage is approximately ~15-20% with the web client open and an account unlocked. Without the web client open (still unlocked) it is less than ~10% most of the time (it occasionally peaks higher and MAY occasionally spike to full load). Memory usage is about 100MB
Once this software is installed on your Raspberry Pi, it will start automatically on boot. You can administer it using remote desktop from another PC.
This tutorial makes the following assumptions; adjust accordingly!
- your installation PC's is running Windows and has an IP of 192.168.1.20
- your network router's IP is 192.168.1.1
Basic Raspbian install guide
- download and install Raspbian
- Download the Raspbian image from [1]
- Download diskimager for windows [2].
- Install image on an SD Card, and boot the Raspberry from the card. You should see a config menu.
- Expand filesystem and change your password.
- Enable boot to desktop.
- Set internationalisation options (language, keyboard and timezone)
- Under advanced options enable ssh and set a hostname like "rpi".
- Reboot. Now you should see a desktop and the system is running
Update the system
- open the bash commandline (LXTerminal), type the following, and follow the instructions:
sudo apt-get upgrade
sudo apt-get dist-update
- Check your IP configuration
- Your Pi should pick up an IP address from DHC, and this can be confirmed with the
ifconfig
command in a shell. To configure a static ip, open the bash commandline (LXTerminal) and type the following:sudo nano /etc/network/interfaces
- Change the following entry from:
iface eth0 inet dhcp
To:iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
- Press CTRL and O at the same time to save the file
- Press CTRL and X together to exit
- Reboot your Pi
- Your Pi should pick up an IP address from DHC, and this can be confirmed with the
Install XRDP (RDP server)
- Open the bash commandline (LXTerminal) and type the following, and follow the instructions:
sudo apt-get install xrdp
sudo apt-get upgrade xrdp
- Now you can use Microsoft Remote Desktop and work remote on the Raspberry.
- In windows go to start -> open -> and type "mstsc"
- Enter your Raspberry's address (192.168.1.10), connect and sign in with your password
Router/firewall port forwarding
- Make sure to forward TCP port 7874 tcp on your network router to the IP your raspberry has (192.168.1.10)
Install NXT Client
You have two possible options here:
- Use your Raspberry Pi with the standalone package Oracle JRE included (all credits to the author: davethetrousers )
- Download the
tar.gz
file from davethetrousers' mirror with wget and extract it:wget http://109.230.224.65/../~nxt/nxt_rasppi.tar.gz
tar -xf nxt_rasppi.tar.gz
- To start NRS automatically on raspberry reboot edit the run_nxt.sh file in nxt folder:
nano nxt/run_nxt.sh
- Edit the run_nxt.sh file to look like this:
#!/bin/bash
#
# A script to run the NXT server on a Raspberry Pi, using the provided standalone JRE
#
# created by davethetrousers
#
cd /home/pi/nxt/
/home/pi/nxt/ejre1.7.0_45/bin/java -Xms320m -Xmx450m -jar /home/pi/nxt/start.jar STOP.PORT=11111 STOP.KEY=123456 > nxtout.txt 2> nxterr.txt
- Press CTRL and O at the same time to save
- Press CTRL and X together to exit.
- Enter:
crontab -e
- Insert the code at the end of the file:
@reboot /home/pi/nxt/run_nxt.sh
- Press CTRL and O at the same time to save
- Press CTRL and X together to exit.
- Now the raspberry should be able to load the NRS software on boot#Step by step installation from devs mirror with build in raspbian java
- Download the NRS client (current version: 0.5.8) http://download.nxtcrypto.org/../nxt-client-0.5.8.zip
- SHA256 hash -
4f0ceb4583ba50a7b791635586249868958c90899d7a5033d2c763c701b859d5
(source: Nxt blockchain alias) (you really should check here to make sure this matches your downloaded file's checksum before you install anything!)
- SHA256 hash -
- Unzip the file:
unzip nxt.zip
- Now the NRS client is in your home folder (
/home/pi/nxt/
) - Make a new file in the [i]/home/pi/nxt/[/i] folder and name it something like "[i]run_nxt.sh[/i]":
nano nxt/run_nxt.sh
- Insert the following code:
#!/bin/bash
cd /home/pi/nxt/
/usr/bin/java -Xms320m -Xmx450m -jar /home/pi/nxt/start.jar STOP.PORT=11111 STOP.KEY=123456 > nxtout.txt 2> nxterr.txt</code>
- Press CTRL and O at the same time to save, Press CTRL and X together to exit.
- Enter:
crontab -e
- Insert the code at the end of the file:
@reboot /home/pi/nxt/run_nxt.sh
- Press CTRL and O at the same time to save
- Press CTRL and X together to exit.
- Insert the code at the end of the file:
- Now the raspberry should be able to load the NRS software on boot
- Download the
Stop script for the Nxt software
- Create a new file in the [i]/home/pi/nxt/[/i] folder and name it something like "[i]stop_nxt.sh[/i]":
nano nxt/stop_nxt.sh
- If you are using davethetrousers' Java package, enter this code:
/home/pi/nxt/ejre1.7.0_45/bin/java -jar /home/pi/nxt/start.jar STOP.PORT=11111 STOP.KEY=123456 --stop
- If you downloaded the Nxt software directly:
/usr/bin/java -jar /home/pi/nxt/start.jar STOP.PORT=11111 STOP.KEY=123456 --stop
- If you are using davethetrousers' Java package, enter this code:
- Press CTRL and O at the same time to save
- Press CTRL and X together to exit.
Now you can stop the client on bash command line with the following command:sudo bash nxt/stop_nxt.sh
Before reboot your Pi, you should use this script to prevent a blockchain error!
Now you can reboot the system with:sudo reboot
Connecting from your PC instead of localhost
- Edit
web.xml
to connect with your browser from another pc instead of localhost:nano nxt/webapps/root/WEB-INF/web.xml
- After [i]<param-name>allowedUserHosts</param-name>[/i] add:
<param-value>127.0.0.1; localhost; 192.168.1.20; 0:0:0:0:0:0:0:1;</param-value>
- Press CTRL and O at the same time to save
- Press CTRL and X together to exit
Manually start forging with the NRS client
To start forging you will need to be logged in with your web browser once.
- Open https://192.168.1.10:7875
- Confirm the SSL notification
- Click on the padlock
- Unlock your account with your passphrase (unlocking an address takes a few seconds).
If the client is unlocked you can close the browser and the system will begin forging.
Handling NRS and Java errors
You can check the java logfiles (nxtout.txt and nxterr.txt) in the nxt folder for errors!
Having issues?
Check the FAQ and the "common problems and resolutions" pages!
Additional useful commands and tools
Mount your local windows hard drive remotely, for Raspberry Pi data sharing
sudo mount -t cifs //192.168.1.20/c$ /mnt -o user=myusername
Where:
- x = The IP address of your Windows PC
- myusername = your username on the windows PC
sudo raspi-config
Check the built-in Java configuration
sudo update-alternatives --config java
(The standard location is marked with a star, and the path is something like [i]/usr/lib/jvm/jdk-7-oracle-armhf/jre/bin/java[/i]/ The defaults are [i]priority = 317[/i] and [i]auto-modus[/i]. If that is ok, confirm by pressing Enter.
Remote administration with putty
You can manage your raspberry with the tool "putty" through a command line SSL connection. Download the tool from [3]