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
If this tutorial has been helpful for you, dont be shy and donate some spare drk in my pocket. Thank you!
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.