Running a NEM Node on a Raspberry Pi

Great stuff! I’ve just recently set up a Pi 3b node too, so I hope you don’t mind my adding a couple of notes.

I was initially having issues with the launch script starting NIS with too much RAM given over to it, which resulted in the JVM processes being killed by the kernel after a few hours (as logged in /var/log/kern.log), but reducing the max memory flag to -Xmx768M seems to have done the trick. htop shows RAM maxing out at about 856MB after running the node for ~6 hours (though it does also seem to use a little of the swapfile).

I’ve also dropped the amount of shared graphics RAM down to 16MB using the raspi-config tool, from the default 64MB, as I run it headless with no special graphics requirements/environments.

Finally, I’m a fan of using the process manager Supervisor to daemonise and automatically start/restart NIS, as it also gives you a web panel to manage processes. Handy to be able to see this on the network without needing to ssh in to the Pi.

1 Like

Thank you for your guide. I’m still not understanding everythin though.

What do you do after “downloading the standalone client package from NE.io/install” and before “starting to sync the chain”

Seems like some missing steps. Do I put the folder somewhere? Do I need to open a specific file? How do you start syncing?

Thank you again.

Let’s suppose I had delegated harvesting turned on for some remote node, not on my network. Now I want to switch from the remote node to an instance of .nis running within my local network.

How would I do that?

Do I have pay 6 NEM to deactivate the original remote harvester?

I really dislike NEM because it is needlessly complicated and obscure. And it just chews up fees.

And yes, I have scoured for guides and they are all pretty mediocre and incomplete.

The 6 XEM is a one-time fee. You pay nothing to deactivate and switch to your own node.

Turns out, that is not the case. I was running NIS and NCC and when I went to NCC to deactivate, I was indeed charged 6 NEM (as of yesterday, Sunday). Now if that isn’t the case under the Nano light wallet, fine and dandy. But that is not how it worked with NCC. Your information is inaccurate, but I don’t really blame you for that.

I would also note that while NIS 0.6.93 worked just fine (after changing the path environment for Java, which is not really covered in any NEM tutorial that I have seen), NCC 0.93 refused to work at all. Sure, it was “deprecated” in early July, I guess. So I had to go back to NCC 0.6.87 - and you cannot switch delegated remote nodes without paying a fee in NCC 0.6.87.

And why did I use NCC at all?

Well, one has to convert one’s NCC wallet in a convoluted process into a new format recognized the NanoWallet. I"ve owned NEM for about 10 months and during that time it has changed radically, the documentation has not kept up, and it remains way too complicated for most people to adopt. I delegated mining for over 12,000 NEM back in April. As of yesterday, not a fraction of one reward earned, which is why I wanted to cancel the delegated harvesting.

The entire NEM model seems doubtful. They have moved away from local mining rewards to pushing delegated mining. And who benefits the most from that?

I’ve only ever used Nano, but a quick search shows that due to the difference in the wallet systems between NCC and Nano, you do indeed need to spend 6 XEM to deactivate via NCC before restarting with Nano.

Did you see these posts?

2 Likes

hi, i am getting the following error

./nix.runNis.sh no such file or directory

i am running this at the command prompt

pi@raspberrypi:~ $ ./nix.runNis.sh

Could you do an updated version of this As the file types seem to have changed see below list: which on should I use.

Name Last Modified Size Type
Parent Directory/ - Directory
.well-known/ 2017-Jul-06 20:10:57 - Directory
beta-testnet/ 2017-Jul-06 19:59:33 - Directory
bin/ 2016-Jan-29 12:06:37 - Directory
docs/ 2017-Mar-20 20:37:38 - Directory
installer/ 2017-Jul-30 16:40:10 - Directory
last-ncc/ 2017-Jul-30 16:40:10 - Directory
org.nem.core/ 2017-Jul-30 16:35:20 - Directory
README.txt 2014-Jul-28 23:15:37 1.8K text/plain
lightwallet-standalone-1.8-cdn-nginx1.8.zip 2016-May-16 20:33:09 1.3M application/zip
lightwallet-standalone-1.8-cdn-nginx1.8.zip.sig 2016-May-16 20:33:11 0.2K application/pgp-signature
nis-0.6.93.tgz 2017-Jul-30 16:35:18 25.1M application/x-gtar-compressed
nis-0.6.93.tgz.sig 2017-Jul-30 16:35:18 0.1K application/pgp-signature
nis5_mainnet-1002k.h2.db.zip 2017-Feb-28 19:19:56 290.0M application/zip
nis5_mainnet-1002k.h2.db.zip.sig 2017-Feb-28 20:51:20 0.1K application/pgp-signature
nis5_mainnet-1129440.h2.db.zip 2017-May-28 17:53:42 332.1M application/zip
nis5_mainnet.h2-1252k.db.zip 2017-Aug-22 18:46:22 398.2M application/zip
servant_0_0_4.zip 2016-Jun-01 11:02:45 10.0M application/zip
servant_0_0_4.zip.sig 2016-Jun-01 11:03:31 0.2K application/pgp-signature
test.json 2015-Apr-21 22:32:29 0.1K application/json
version.json 2017-Jul-30 16:35:20 0.1K application/json
version.txt 2017-Jul-30 16:35:20 0.1K text/plain
version_p.js

Did you use the right directory ?
It should be… "~NEM/0.6.93/package/ " on your prompt. Then run " ./nix.runNis.sh " .

You download the " nis-0.6.93.tgz " and go in the directory(only NIS).

Only for the wallet use the NanoWallet from the NEM Website.

When you use “nis-0.6.93.tgz” and you will load the db faster use " nis5_mainnet.h2-1252k.db.zip 2017-Aug-22 18:46:22 398.2M " and after unpacking , copy(change) the db in your home/…~/nem/nis/data/…

HI thanks for the reply. I have downloaded nis-0.6.93.tgz to the downloads folder - where should this folder go?

I dont have ~NEM/0.6.93/package either and I dont see where you created the ~NEM

not sure if i have nix/ either

UPDATE:

solved,

wget https://bob.nem.ninja/nis-0.6.93.tgz

tar -xvzf nis-0.6.93.tgz

rm nis-0.6.93.tgz

mkdir nis

mv package nis/package

Then before I could type the comand:

./nix.runNis.sh

I had to type at the command prompt

pi@raspberrypi:~ $

cd / home/pi/nis/package

then I could type

./nix.runNis.sh

oddly enough after runing the code I went back to file manager and the NEM folder appeared - I could also see the database file. weird?

hope this helps others.

one final note.

nis.bootkey =

in the config file it is written as

#nis.bootkey = #delegated private key

If we are NOT harvesting can this be left as it is.

if we DO harvest - Then both # have to be removed?

1 Like

Hi,
sorry, when I ask. What is the reason for you to run this NIS ?
Your own NIS for your NanoWallet ?

The “nis.bootkey” is for harvesting run directly in your running NIS. Then you remove " # " and provide your delegated privat key in this field.
And then you should give your NIS an Name(nis.bootname), so you can see your NIS in nembex after a short time…

PS: We all have a bit different ways(folders) to install software.

hi, I am only providing a node at the moment to help verify transactions on the network. I am aware about putting my private key and node name in for harvesting. my nano wallet is run on a different pc. I’d not have got this far without your initial guide thou.

Not your privat key…your delegated private key ------it´s different and very important

Did you open the port 7890 ?

Yeah…Delegated private key.

Yes port opened. Node is off at the moment planning on running tomorrow.

Out of interest opening port 7890 does mot leave the rest on my home network at risk does it?

Everyone see your IP, have a look at nembex. Every Node with IP.

Your own risk.

HI, I am looking to get the node to run from Boot up. I am using systemctl to run the command to do this but I don’t understand the file structure of ./nix.runNis.sh I can point the the file location upto /packages but getting stuck after this.I have tried:

 packages ./nix.runNis.sh
 packages/nix/runNis.sh
 packages/runNis.sh
 packages ./nix/runNis.sh

neither of these formats seem to work, I don’t know if the file structure is too deep. But some examples or using the systemctl seem to work when the extension is /filename.sh. and not ./filename.othername.sh

./nix.runNis.sh

means run from current directory

to make this work you should first change directory with cd "/path-directory/package/"
or whatever is called on your system and then you will be able to
run the script as described above.

You could maybe try create a separate bash script that does the above:

#!/bin/sh
cd /path/package/
./nix.runNis.sh

and call that

or maybe you could try the following absolute path with systemctl:

/path/package/nix.runNis.sh

Let me know if that worked for you.

Hi Freigeist thanks for helping. I have created a new bash script and change the systemctl file to test but still no good. This is what I got at the cmd line:

pi@raspberrypi:~ $ systemctl status nemNode
● nemNode.service - nem node
   Loaded: loaded (/etc/systemd/system/nemNode.service; static)
   Active: inactive (dead)
pi@raspberrypi:~ $ systemctl start nemNode
Failed to start nemNode.service: Access denied
pi@raspberrypi:~ $ 

This is what I have in nemNode.service file

[Unit]
Description=nem node
After=multi-user.target

[Service]
Type=idle
ExecStart=/home/pi/nis/package/nix.runNis.sh

[install]
WantedBy=multi-user.target

This is what I tried in .nix.nisRun.sh file

#!/bin/sh
cd /home/pi/nis/package/
./nix.runNish.sh

But this did not work at the cmd line see above.

The original .nix.nisRun.sh file had this:

#!/bin/bash

cd nis
java -Xms512M -Xmx1G -cp ".:./*:../libs/*" org.nem.deploy.CommonStarter
cd -

When I manually enter

cd /home/pi/nis/package

then hit Return, and then type:

./nix.nisRun.sh

The program runs.