Nxt Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client 1.11.4 - NEW RELEASE: Ardor 2.0.2e TestNet IS LAUNCHED!

Pages: [1] 2 3  All

Author Topic: [blog] Nxt-in-a-box: How to setup a dedicated Nxt node on a Raspberry Pi 2  (Read 5486 times)

coretechs

  • Board Moderator
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 403
    • View Profile
  • Karma: +153/-1

https://nxtportal.org/blog/nxt-in-a-box-rpi2.html

Please direct questions/comments here.  I will try to keep the links updated.


History:
2016.1.27 - updated references to Nxt release 1.7.5
2016.1.31 - added Oracle Java install instructions, removed OpenJDK instructions, added simplified SSL/TLS configuration steps
2016.4.2 - added blockchain download links
2016.4.19 - updated Java & Nxt release versions/links, added Nxt.org link.
2017.2.11 - updated Java & Nxt release versions/links
« Last Edit: February 11, 2017, 05:59:18 pm by coretechs »
https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
NXT-WY9K-ZMTT-QQTT-3NBL7

yassin54

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2508
  • I am Homer, Sorry my english is Bad!!
    • View Profile
  • Karma: +240/-14

phideas

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 41
    • View Profile
    • Phideas.info |¬†graphic designer and web developer
  • Karma: +16/-0

Good job! Looking forward to your next blog post.
graphic designer and web developer | NXT-KYNB-JC3D-PRS3-99GP5
www.phideas.info | Telegram: @phideas

Fern

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 86
    • View Profile
  • Karma: +15/-3

Great post. With some tweaks, can this work on my pi 1 Model B or is it best to upgrade to pi 2?

allwelder

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1866
  • NxtChina.org
    • View Profile
    • NxtChina.org
  • Karma: +196/-13

Great post. With some tweaks, can this work on my pi 1 Model B or is it best to upgrade to pi 2?
I tested with pi 1 B,worked well. :)
NxtChina |Weibo |Twitter Donation welcomed:NXT-APL9-66GU-K8LY-B3JJJ

Fern

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 86
    • View Profile
  • Karma: +15/-3

Great post. With some tweaks, can this work on my pi 1 Model B or is it best to upgrade to pi 2?
I tested with pi 1 B,worked well. :)
Thanks, what about the memory and swap files changes?

crimi

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 881
    • View Profile
  • Karma: +122/-11

good clean tutorial, thanks shared on peerexplorer
PeerExplorer.com | NodeExplorer.com

MrCluster87

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 836
    • View Profile
    • youtube
  • Karma: +80/-3

Hi Coretechs!! Really nice tutorial indeed.

I would like to republish it on nxter.org and translate it in our 9 languages beside english. What's your thought?

coretechs

  • Board Moderator
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 403
    • View Profile
  • Karma: +153/-1

Hi Coretechs!! Really nice tutorial indeed.

I would like to republish it on nxter.org and translate it in our 9 languages beside english. What's your thought?

Thanks!  Translation would be awesome, please feel free to republish.   :)
https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
NXT-WY9K-ZMTT-QQTT-3NBL7

macht

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
    • View Profile
  • Karma: +0/-0

Nice tutorial! Only thing I cannot seem to get working is setting up SSL.

After entering this command, (keytool -importkeystore -srckeystore mycert.pkcs12 -srcstoretype PKCS12 -destkeystore keystore) , I typed "storepwd" for all three prompts thereafter.

I receive an error after the third time: (keytool error: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded)

Any help is appreciated!

coretechs

  • Board Moderator
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 403
    • View Profile
  • Karma: +153/-1

Nice tutorial! Only thing I cannot seem to get working is setting up SSL.

After entering this command, (keytool -importkeystore -srckeystore mycert.pkcs12 -srcstoretype PKCS12 -destkeystore keystore) , I typed "storepwd" for all three prompts thereafter.

I receive an error after the third time: (keytool error: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded)

Any help is appreciated!

Hmm, I'm not sure what is causing that error.  Perhaps you are referencing a file from an earlier attempt that has a different password?  Have you tried deleting mycert.*, privkey.pem and the keystore and starting from scratch?  I just recreated another test cert (using "storepwd" for every password) on my rpi2 using the steps from the wiki without issue.

Tosch110 reported running into the same error in Riker's thread (https://nxtforum.org/public-nodes-vpss/setting-up-sslhttps-on-a-public-node/20/) perhaps he knows a solution.
https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
NXT-WY9K-ZMTT-QQTT-3NBL7

MrCluster87

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 836
    • View Profile
    • youtube
  • Karma: +80/-3

Hi Coretechs!! Really nice tutorial indeed.

I would like to republish it on nxter.org and translate it in our 9 languages beside english. What's your thought?

Thanks!  Translation would be awesome, please feel free to republish.   :)

Published!!! http://nxter.org/how-to-set-up-a-nxt-node-on-a-raspberry-pi-2/

Translations will follow shortly  ;).

Thank you again!!

MrCluster87

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 836
    • View Profile
    • youtube
  • Karma: +80/-3

Hey!!

Let's say that I want to build a future proof system, so let's say that the Nxt Blockchain would be 15 Gb, is it possible to associate a NAS to this raspberry pi 2 full node config?

Since I'm lazy, I would go with a plug and play solution such as Western Digital WD My Cloud: https://www.youtube.com/watch?v=078xdmH1DiM

what are your suggestions?

RocketBunny

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 64
  • Big engines fan
    • View Profile
  • Karma: +4/-2

Hey!!

Let's say that I want to build a future proof system, so let's say that the Nxt Blockchain would be 15 Gb, is it possible to associate a NAS to this raspberry pi 2 full node config?

Since I'm lazy, I would go with a plug and play solution such as Western Digital WD My Cloud: https://www.youtube.com/watch?v=078xdmH1DiM

what are your suggestions?

Just move nxt_db folder to your WD and make symlink from nxt folder.
NXT: Vadym
My public node http://nxt.bevolved.net:7876

coretechs

  • Board Moderator
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 403
    • View Profile
  • Karma: +153/-1

Hey!!

Let's say that I want to build a future proof system, so let's say that the Nxt Blockchain would be 15 Gb, is it possible to associate a NAS to this raspberry pi 2 full node config?

Since I'm lazy, I would go with a plug and play solution such as Western Digital WD My Cloud: https://www.youtube.com/watch?v=078xdmH1DiM

what are your suggestions?

Just move nxt_db folder to your WD and make symlink from nxt folder.

Good suggestion.  Step-by-step instructions (assuming your external drive is already mounted):

Code: [Select]
mv ~/nxt/nxt_db /path/to/WD_mountpoint/
ln -s /path/to/WD_mountpoint/nxt_db/ ~/nxt/nxt_db



If you don't want to use a symlink you can configure a different database path in your nxt.properties file using the nxt.dbUrl configuration option instead.  Note that you would still need to move the nxt_db directory to your external disk first.

Code: [Select]
nxt.dbUrl=jdbc:h2:/path/to/WD_mountpoint/nxt_db/nxt;DB_CLOSE_ON_EXIT=FALSE;MVCC=TRUE;MV_STORE=FALSE
https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
NXT-WY9K-ZMTT-QQTT-3NBL7

penoze

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 69
    • View Profile
  • Karma: +4/-1

trying out now  ;D
This is also the first time i use a raspberry.

Maybe this is a n00b question but what i must fill in here:

The following is an example configuration file:

nxt.myAddress=12.34.56.78
nxt.apiServerHost=0.0.0.0
nxt.allowedBotHosts=*
Altinvest
Asset ID: 9923803162541911347

coretechs

  • Board Moderator
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 403
    • View Profile
  • Karma: +153/-1

trying out now  ;D
This is also the first time i use a raspberry.

Maybe this is a n00b question but what i must fill in here:

The following is an example configuration file:

nxt.myAddress=12.34.56.78
nxt.apiServerHost=0.0.0.0
nxt.allowedBotHosts=*


You only need to put your public IP address for nxt.myAddress if you opened the port on your firewall.  Otherwise you can remove that parameter and leave the other two as they are.
https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
NXT-WY9K-ZMTT-QQTT-3NBL7

coretechs

  • Board Moderator
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 403
    • View Profile
  • Karma: +153/-1

I'm in the process of updating the post to recommend Oracle Java instead of OpenJDK for performance reasons.

If you have already installed OpenJDK, it's not too difficult to remove it.  Stop the Nxt server and run the following:

Code: [Select]
sudo apt-get remove openjdk-8-jre
sudo apt-get autoremove

Download the Oracle JDK version for Linux ARM 32 Hard Float ABI from here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

To use wget you have to include a header to accept the Oracle license:
Code: [Select]
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u71-b15/jdk-8u71-linux-arm32-vfp-hflt.tar.gz

Extract the file:
Code: [Select]
tar xvzf jdk-8u71-linux-arm32-vfp-hflt.tar.gz

Rename and move the extracted directory:
Code: [Select]
sudo mv jdk1.8.0_71/ /usr/local/java

Update your system to use java at this location:
Code: [Select]
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/bin/javac" 1
sudo update-alternatives --set java /usr/local/java/bin/java
sudo update-alternatives --set javac /usr/local/java/bin/javac

Set your environment variables:
Code: [Select]
sudo nano /etc/profile

Add the following to the end of the file:
Code: [Select]
JAVA_HOME=/usr/local/java
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

Reload /etc/profile and check the java version:
Code: [Select]
source /etc/profile
java -version

If everything is correct you should see the following output:

java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) Client VM (build 25.71-b15, mixed mode)

When new versions of Oracle Java are released, you can simply extract them and overwrite the directory at /usr/local/java.
https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
NXT-WY9K-ZMTT-QQTT-3NBL7

penoze

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 69
    • View Profile
  • Karma: +4/-1

trying out now  ;D
This is also the first time i use a raspberry.

Maybe this is a n00b question but what i must fill in here:

The following is an example configuration file:

nxt.myAddress=12.34.56.78
nxt.apiServerHost=0.0.0.0
nxt.allowedBotHosts=*


You only need to put your public IP address for nxt.myAddress if you opened the port on your firewall.  Otherwise you can remove that parameter and leave the other two as they are.

okay if i fill in:

nxt.myAddress=(my ipadress)
nxt.apiServerHost=0.0.0.0
nxt.allowedBotHosts=*

It should be good?
Altinvest
Asset ID: 9923803162541911347
Pages: [1] 2 3  All