Masternode On Raspberry Pi 2 Model B

darkred

Active Member
Feb 6, 2015
235
262
123
Let me know if you find the script. I'm curious.

To compile darkcoind on pi1, it took:
real 324m32.232s
user 305m2.510s
sys 5m43.480s

Did not do any swap changes from default.

So, looks like it might work.

It starts up...

[email protected] ~ $ ./darkcoind
Darkcoin server starting
[email protected] ~ $ ps -ef | grep darkcoin
pi 3396 1 57 02:06 ? 00:00:03 ./darkcoind
pi 3401 2200 0 02:07 pts/1 00:00:00 grep --color=auto darkcoin

I've fired it up on testnet. Let's see if it syncs.

Looks like memory is not an issue (so far)

[email protected] ~ $ top
top - 02:09:02 up 11:37, 2 users, load average: 1.05, 0.47, 0.20
Tasks: 71 total, 1 running, 70 sleeping, 0 stopped, 0 zombie
%Cpu(s): 11.9 us, 18.6 sy, 66.1 ni, 0.0 id, 0.0 wa, 0.0 hi, 3.4 si, 0.0 st
KiB Mem: 445740 total, 364896 used, 80844 free, 10936 buffers
KiB Swap: 102396 total, 6408 used, 95988 free, 311904 cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3396 pi 20 0 148m 23m 9564 S 79.3 5.5 1:20.83 ./darkcoind
3446 pi 20 0 4676 2376 2024 R 8.4 0.5 0:00.32 top

Will post later with whether or not it syncs.
 

paperThin

Member
Jun 13, 2014
106
19
68
Spent part of the day working on a RP Ver 1. Going pretty well, but I spent way too much time trying to get the port forwarding working. I can set up my router for port 22 but after many hours still cannot get port 9999 open. About to give up, but decided to proceed with the tutorial. When I bring it to work, I may be able to open the port there.

any ideas? I can open and close the 22 port using UFW on the RP1 and I can open and close the 22 port using the port forwarding on my Netgear router. However I can NEVER get 9999 to open up. I am using "Open Port Check Tool".

DarkRed... thanks for the feedback... I am going to see how far I can take this one.
 

Sandell

New Member
May 24, 2014
9
3
3
I'm working on this right now, have compiled .25 on a RP 1 and it has synced with the blockchain so far. Will try to get a remote masternode up and running.
 

Sandell

New Member
May 24, 2014
9
3
3
It takes about 15 minutes for darkcoind to start, but after that it seems ok. Unfortunately I need to wait until my old MN IP gets out of the system to test again, think that's why I can't see the RPi IP in the masternode list. Will try again in a couple of hours.
 

Sandell

New Member
May 24, 2014
9
3
3
Ok, so I got it up and running. It's showing ,1 in the masternode list, so I guess now I need to wait for it to receive a MN payment to see if it really works.

This was done on a RPi 1 Model B with 512Mb of RAM. As you can see from the "top" command, there is not much free RAM, so it would probably not work as well on a Model A with 256Mb of RAM.

KiB Mem: 445740 total, 419888 used, 25852 free, 62884 buffers
KiB Swap: 249852 total, 64 used, 249788 free, 225836 cached

If you have any questions regarding this, just ask!
 
  • Like
Reactions: fuzzyduck

fuzzyduck

Active Member
Feb 19, 2015
137
113
93
Nice to see it working on a Pi1 with 512mb ram.

If this is taking off we might ask devs for pre-compiled builds for ARM kernel.

To see if your Pi1 is running ok check with:

./darkcoind masternode list | grep YOUREXTERNALIP

If you are low on RAM perhaps its wise to make an auto restart, in case you run out:

https://darkcointalk.org/threads/auto-restart-the-masternode.3103/

My PI2 is running now for about 1week and 4 days orso. Didnt touch it and got two payments. Next one is due today i think
 
  • Like
Reactions: DarthFraktal

Sandell

New Member
May 24, 2014
9
3
3
My latest project has been to get a masternode up and running on a Raspberry Pi 256Mb version, and now that has been successful as well.

I moved the swapspace to a USB-stick and increased it's size to be on the safe side, and it seems to work fine.

Memory utilization:
KiB Mem: 185844 total, 160792 used, 25052 free, 5512 buffers
KiB Swap: 1048572 total, 3468 used, 1045104 free, 40368 cached

The "used" amount can be a little deceiving it seems, since linux uses up as much memory as it can for caching and used files among other things.
 

paperThin

Member
Jun 13, 2014
106
19
68
Fuzzy,

My RP2 arrived today and I am working on your tutorial... a question... Can the normal GUI wallet be run from the graphical environment? I followed the guides for other Linux distros, but no luck. I double-click the darcoin-qt (as downloaded from the darkcoin_io website) and nothing happens. Any ideas?

Thanks!!!!
 

Sandell

New Member
May 24, 2014
9
3
3
The Linux binary that you download is for x86/x64 architecture, and won't work on ARM architecture that the RPi uses. You should be able to download the source from github and compile it on the RPi though.
 

paperThin

Member
Jun 13, 2014
106
19
68
The Linux binary that you download is for x86/x64 architecture, and won't work on ARM architecture that the RPi uses. You should be able to download the source from github and compile it on the RPi though.
Thanks Sandell! I did that over the weekend (for the darkcoind). Just follow the same steps for darkcoin-qt?
 

paperThin

Member
Jun 13, 2014
106
19
68
Working great! I am running Wheezy on a RP2. In the GUI environment, I have the darkcoin-qt 11.1.25 running beautifully. Yesterday I did an instantX send (to the RP2) which took less than 1 second to arrive and confirm. Very cool.
It has been running for a day and seems to be very stable. I have a 16G sd card, but using slightly less than 7G. I already am synced with the blockchain. Could be possible on a 8G card... not sure.

The trick was to just follow Fuzzy's guide. Add this step:
sudo apt-get install protobuf-compiler libprotobuf-dev

I had noticed an error message after running the ./config step that prompted me to look for the above.
I like having a stand-alone wallet that is not "bogging down" my work PC. It is nice that Dark denominate mixes fast on the RP2, but the credit really goes to 11.1.25, I think. Let me know if anyone has questions.
Glad I could actually contribute something (small).
 
  • Like
Reactions: fuzzyduck

paperThin

Member
Jun 13, 2014
106
19
68
Any reason this could not be run as a masternode in the GUI environment?
(I would prefer this since I am a linux idiot ! :)
 

fuzzyduck

Active Member
Feb 19, 2015
137
113
93
I guess the masternode can be run in the GUI environment, but i tend not to ticker with my Pi2 once its running. Therefor i didnt add that part to the tutorial on purpose.
My Pi2 is running non stop in the cupboard for over almost 4 weeks now, without reboots or lockups. Its really great! I think one more payment and the PI2 paid for itself :)

EDIT: Im back from holiday so more active again to maintain this thread ;)
 

paperThin

Member
Jun 13, 2014
106
19
68
What would be the minimum required upload speed for running a masternode on a PI?
I would say that the upload requirement is very low. I am running my MN on a virtual server that shows the monthly bandwidth. I have used less than 1% of 1TB and that includes the loading of the blockchain.
If you are trying to do this out of your house... I think the toughest part will be having a static IP and opening/ closing the right ports.
The best thing to do is try it. The fancy MN monitoring website (drk dot mn) shows % uptime. After a few days you will see how much uptime you have. If it is at 100%, then you won't have to worry about missing payments. Good luck!
 

Wavelength

New Member
Mar 19, 2015
3
0
1
I would say that the upload requirement is very low. I am running my MN on a virtual server that shows the monthly bandwidth. I have used less than 1% of 1TB and that includes the loading of the blockchain.
That calculates to 39 kB/s. My upload speed is capped around 100 kB/s, so it should be doable. I needed to know this before considering buying and setting up a Raspberry Pi.

Thanks
 

paperThin

Member
Jun 13, 2014
106
19
68
That calculates to 39 kB/s. My upload speed is capped around 100 kB/s, so it should be doable. I needed to know this before considering buying and setting up a Raspberry Pi.

Thanks
Well, if you're going to get that specific! ;)
It was 7.5GB, but that is up and down traffic combined. So the upload traffic must be much lower than your calc. Are you thinking to use a RP1 or RP2?
 

fuzzyduck

Active Member
Feb 19, 2015
137
113
93
Id suggest a PI2, because you also can do other stuff with it, like a fullblown mediapplayer for your tv for instance. Look up Kodi http://kodi.tv/.
It runs way better on the Pi2 then Pi1.

IF you get a Pi2, get the model B which had 512 mb ram.
 
Last edited by a moderator:

fuzzyduck

Active Member
Feb 19, 2015
137
113
93


After watching it for 2min it seems to hoover between 2 and 14KB/sec, so 8 seems about average for up n down.Once in a while it spikes to 20 for half a second.

Ive downloaded lots of stuff meanwhile at the full glassfiber speed i got @ 10MB/sec and my node stays 100% up. Its up almost 5 weeks now nonstop without reboot or tinkering. I just check drk.mn once in a while.
 

tungfa

Grizzled Member
Foundation Member
Masternode Owner/Operator
Apr 9, 2014
8,902
6,740
1,283
NOOBIES GUIDE GETTING A MASTERNODE TO RUN ON A RASPBERRY PI 2 MODEL B

Thx to user Sandell its now also confirmed its working on a Pi 1 model B(512mb ram). Not sure about stability though cuz of lack of free ram)



WHY?
A week, ago my Raspberry pi 2 arrived and was delighted to finally get a masternode run on it, instead of hosting it at a VPS(thx for that Flare).
It all went well and its running as i write this. With help of various people by mail and on the forums I decided to contribute to write a howto tutorial with all the new stuff i have learned.


NEEDED KNOWLEDGE?
Almost no prior knowlegde. As a windows-boy i know my way around pc's except hardcore coding n stuff. Ive been playing around in Ubuntu as well in a virtual machine just to see what it means to run a linux distro. Im classify myself as a linux noob. So if i can do it, you can do it too ;)

This guide can be written way more more compact but didnt do that on purpose for you to follow easily. I made it the most no-brainer i could.

"Like warm raspberry pi"





MY SOURCES?

I grabbed different sources to make this tut. Mainly TAO's tut for some shameless copy paste (THX!), some forum posts for the basic setup of the pi2 (THX!)


SPEED OF THE PI2?
The compiling of the needed file for the master node takes about 1.5/2h until done. The PI2 has an ARM kernel. So just downloading the 32bit/64bit version just doesnt cut it....

We have to compile it ourselfs on the PI2.

There is the possibility to crosscompile on your desktop but that is beyond the scope of this tut. In this tut We will do the 1.5h waitinggame. Compiling is long but not that long.
One you built your first, there is the possibility to leave the Masternode running while compiling the next version. That way you dont have to take it offline for long and miss your valuable DRK.


PREREQUISITES?
1. A raspberry Pi 2 model B, (duh!)
2. >1000drk
3. I did this on windows so its written as such
4. Unlimited data from your ISP
5. A stable highspeed internetconnection with a fixed IP address
6. Know your way around your router OR learn how to
7. SDcard class 10
8. Cardreader
9. Basic nerdskills
10. An girlfriend/wife who understands what you are doing at night and why its so awsome. (I failed at this one, girlfriend yes, understanding? Nah)/


ISP TEST (Do both tests before continuing)

Test 1:
go to whatismyipaddress.com and take note of your IP. Then pull the plug on your modem, wait a bit and replug. Check the page again. If the same then good!

Test 2:
: Take note of IP address and wait 24h and check again. If the same then good!


DISCLAIMER
Running a Masternode on a PI2 is hardly tested for a longer period of time. Besides, they just got out. Mine is running 24/7 at this moment with no issues, but i cannot guarantee yours will too. So i will take no responsibility for what ever happens to yours. As with the crypto-scene, its highy experimental! At your own risk.

DONATIONS
:rolleyes:If this tutorial has been helpful for you, dont be shy and donate some spare drk in my pocket. Thank you! :rolleyes:

XdptGDg2mMQ7wrcp8eUDtTkSPW71vMteBF



HERE WE GO!

1. Grab gear

Take a grab in your hardware box and take out a micro SHcard class 10 and a cardreader, or buy these. These puppies are cheap so grab a large one. I got a 32gb, for lateral future use also. Even cameras take these. Be sure it fits in your cardreader, else dont forget an SD-adapter. They are usually in the package of the product.


2. Grab Operating System

Head to http://www.raspberrypi.org/downloads/ to download the latest RASPBIAN image. Unpack the file to whatever dir you like. Dont use older ones because they dont run on the PI2.


3. Flash OS to sdcard

Head to http://www.raspberrypi.org/documentation/installation/installing-images/ and follow the tutorial to get the downloaded and unpacked image (.img file) on the sdcard. I did the Windows tutorial. After you have flashed the IMG-file to the card put it in your pi2. Be gentle, its a delicate slot.


4. Booting

Hook up the Pi2 to your router with an ethernet cable. We do want a stable connection so no wifi (i tried it and worked flawlessly, but eventually i moved it to my router with a 1.5m cable, besides wifi needs tinkering with files on the PI2 and im not gonna bother you with it atm).

Then hookup it up to a powersupply (i got it running on a 1,5Amps phonecharger. Just dont go hooking all sorts of USB on it because then you might need more amps. Im using mine as a decicated mastenode box.

Your pi2 is now booting the operating system you just flashed to the SDcard.


5. Fetching the IP

On Windows press windowsbutton+R. type 'cmd' and press enter. You enter a DOS box. type IPCONFIG and press enter. Scroll up a bit till you see Standard Gateway. Take note of the IP. 99% of the time it starts with 192.168.1.xxx or 192.168.0.xxx


6. Config your router

Start your browser and enter that IP. You will now see your router's website. Enter login + password (sticker on router?)
In the menu's somewhere there is a list of connected devices. They all have a IPaddress. Take note of the one called RASPBERRY.

Somewhere in the menus of your router you can do a DHCP reservation for the IP address of the PI2. This means everytime the PI2 boots it gets the same IPaddress. Thats what we want. We dont want it to change. Dunno your router so cannot help on this one :( Check manual or do a search on it. You should find some other tut.)

Now also somewhere in the menu of the router there is a NAT or PORT FORWARD menu. Enter the IPaddress of the PI2 and open port 9999. Usally by just filling all portboxes with 9999. IN / OUT etc. Maybe you just have one box to put it in.

Save the config of the router and reboot it. (also in the menus somewhere)

You are now re-routes internet traffic on port 9999 to your Pi2.

Check http://www.yougetsignal.com/tools/open-ports/ and fill in port 9999 to find it open.


7. Putty for a terminalconnection

No head to you desktop and download putty @ www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Take the top one Intel x86 is fine.

Drag it to your desktop and start it. Enter the IPaddress of the pi at the Host Name, fill Masternode or whatever at Saved Sessions and press Save. That way you can easily load it again. Press Open.

Now you see a black box with a prompt. Enter 'pi' as login and 'raspberry' as password. You then see a green with blue prompt.


8a. Setup the PI2

Now we are gonna setup the PI2 just a little bit before continuing. From now on, whenever you see a RED line then thats a command. Type it and hit enter.

sudo raspi-config

You are shown a simple menu. We are gonna do options 1 2 and 3. Use the arrows and tab to navigate.
1. Expand the filesystem so it uses the whole 32gb of the SDcard
2. Change the password of the user pi. Make a strong password like you do so your darkcoin wallet.
3. Make it boot to command-line. So that way we safe some ram by not loading the desktop enviroment we will not be using at all.

I forgot if it reboots automaticly or manually. If manual, then:

sudo reboot

Putty will give an error it has lost connection. Reopen Putty and log in again after 1min. Remember you got a new password for the user 'pi'.


8b. Change root password and change username pi

Next we change to root password to something strong as well. Choose a long one:

sudo passwd

Close putty and login with user 'root'

Change username 'pi' to your loginname

sudo usermod -l NEW -d /home/NEW -m pi
sudo chown NEW /home/NEW


Close putty and login with your new login name.


9. Download and install the needed packages

At the prompt type the following commands in this order to fully update the pi and get it ready for compiling. Press yes to all when asked.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade


sudo apt-get install libtool autotools-dev autoconf libdb-dev libminiupnpc-dev dh-autoreconf libdb++-dev libboost-all-dev libssl-dev pkg-config joe ufw protobuf-compiler libprotobuf-dev

Just copy the whole thing and rightclick mouse in the putty screen. If it fails do one by one as written down here:

# sudo apt-get install libtool autotools-dev autoconf
# sudo apt-get install libdb-dev
# sudo apt-get install libminiupnpc-dev
# sudo apt-get install dh-autoreconf
# sudo apt-get install libdb++-dev
# sudo apt-get install libboost-all-dev
# sudo apt-get install libssl-dev
# sudo apt-get install pkg-config
# sudo apt-get install joe
# sudo apt-get install ufw
# sudo apt-get install protobuf-compiler libprotobuf-dev


there is maybe one too much in the list but this does the job for sure (maybe somebody can tell me which one is not needed, I grabbed them from different tuts.)


10. Config the Firewall

We are going to configure the firewall on the PI2 you just installed to block all ports except port 22(for putty) and 9999(for masternode):

sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw allow 9999/tcp
sudo ufw logging on
sudo ufw enable


It should say active.
Can you please start working on "rebranding" the guide ?!
that would be great and super appreciated
Tx
 

fuzzyduck

Active Member
Feb 19, 2015
137
113
93
In the process of rebranding the tutorial. Please be patient(could be that you see dash and darkcoin simultaneously for some time). I have to retrace my writings if im correct.

Ill post here when im done.
 
Last edited by a moderator:
  • Like
Reactions: Dunedoo and tungfa

fuzzyduck

Active Member
Feb 19, 2015
137
113
93
OK Done with the rebranding of Darkcoin to Dash.

Note that when downloading the newest source from github, the directories are still called darkcoin. So it can be confusing:
1. The masternode file is DASHD
2. The github clone dir is called darkcoin
2. The hidden directory with the config/blocks etc in it is called .dash

If any sees an error please let me know. thx!;)

remember that.
 
  • Like
Reactions: Dunedoo and tungfa

Solarminer

Well-known Member
Apr 4, 2015
762
922
163
Great guide. Thanks for making it.

I would add this to your guide to make step 13 easier.
sudo apt-get install screen
to start the xxxx process in detached mode:
screen -dmS ./xxxx
To resume type:
screen -r or sudo screen -r (if you ran with sudo)
To detach the screen again so you can logout.
<control>a d
screen -ls will see the other things that are detached and you can do screen -r xxxx to resume a specific process.
 
Last edited by a moderator:
  • Like
Reactions: fuzzyduck