Gravium Masternode on a Raspberry PI3

Sidewinder
4 min readJun 8, 2018

This guide will show you how to run a gravium masternode on a raspberry pi3, it is not the most efficient hosting compared to a cheap VPS, but it can be a fun project. If you came looking for a guide on how to install on a VPS, have a look here

(Disclamer: This guide takes no responsibility for any damage you might do to your raspberry pi 3 or associated SD card)

  1. Local wallet setup

This part is the same as it would be for a VPS or any server. First of all install the local wallet on your local computer. You can find it here https://github.com/Gravium/gravium/releases/tag/REL

  • Acquire some GRV, you need slightly more than 1000 for a masternode (1000 + transaction fee).
  • Create a receiving address called MN1(File — Receiving Address — New)
  • Send Exactly 1000 GRV to this address, make sure “subtract fee from amount ” is unchecked, wait for 15 confirmations
  • Open the debug console (Tools — Debug Console) and type masternode outputs, this should return something like this, save this value, this is your transaction id and didgit for the transaction of the 1000 GRV
{
"xxxxxxxxxxxxxxxxxxxx": "0"
}
  • Still in the console, type masternode genkey, save the returned value. This will be used to link your local wallet to your masternode, we call it masternodeprivkey
  • Open the masternode.conf file for your local wallet (Tools — Open Masternode Configuration File) and add a row like this with the values you saved:
Alias <ip>:11010 <masternodeprivkey> <transaction id> <didgit>
  • It should look like this:
MN1 123.456.789.123:11010 yyyyyyyyyyyy xxxxxxxxxxxxxxxxxxxx 0
  • Enable Masternode tab (Settings — Options — Wallet — Show Masternode Tab)
  • Restart the local wallet

2. Setup Raspberry

Install raspbian on your raspberry pi 3, there are lots of great guides for this so I will not waste any time on creating one. Don’t do any lite version, get the full one!

Make sure that your router forwards port 11010 to your raspberrys IP

SSH into your raspberry with putty/kitty or some other ssh tool and get to work.

Edit swap config with:

sudo nano /etc/dphys-swapfile

change the CONF_SWAPSIZE row to:

CONF_SWAPSIZE=2048

Restart swap process with:

sudo /etc/init.d/dphys-swapfile restart

(Some people claim that using swap on a raspberry might damage the sd card in the long run, so if you want you can change this to 0 after all the installations are complete)

3. Install and build stuff

First install a bunch of dependencies

sudo apt-get updatesudo apt-get install build-essential libtool automake autoconf  autotools-dev pkg-config libssl-dev libgmp3-dev libevent-dev bsdmainutils libboost-all-dev libminiupnpc-dev libevent-dev

then you need to build a few of the dependencies yourself:

Berkley DB

cd ~
mkdir bin
cd bin
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make
sudo make install

And Boost

cd ~
mkdir boost
cd boost
wget http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.bz2
tar xvfo boost_1_60_0.tar.bz2
cd boost_1_60_0
./bootstrap.sh
sudo ./b2 install

Now we are ready to download the gravium code

sudo apt-get install git
git clone https://github.com/Gravium/gravium

And build it

cd gravium
chmod 755 autogen.sh
./autogen.sh
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-defaultchmod 755 share/genbuild.sh
make

Then copy the binaries to the usr/bin folder and make them executable

cd graviumcore-1.0.2/bin/
sudo cp -t /usr/bin gravium-cli gravium-tx graviumd
cd /usr/bin
sudo chmod +x gravium*

4. Setup and start

Create a .graviumcore folder

cd ~
mkdir .graviumcore

Create a config file

nano ~/.graviumcore/gravium.conf

Add the following text, Fill out all the info in <>

rpcuser=<user>
rpcpassword=<password>
rpcallowip=127.0.0.1
rpcport=11000
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
staking=0
externalip=<server ip>
masternode=1
masternodeprivkey=<masternodeprivkey>

User and rpcpassword can be anything you like, just make it something hard to guess. Server ip is the ip of your server. Masternodeprivkey is the value from step 1.

Start your masternode

graviumd -daemon

Verify it works

gravium-cli getinfo

Wait until it has synced all the blocks

gravium-cli getblockcount

Start your masternode from the local wallet (Masternode tab — My Masternodes — Right click and take start alias)

Verify that it is working with

gravium-cli masternode status

Your local wallet should now say: WATCHDOG_EXPIRED

5. Sentinel

Download and make a fresh install of sentinel, first get some more dependencies

sudo apt-get -y install python-virtualenv

and install

cd ~
git clone https://github.com/Gravium/sentinel.git
cd sentinel
virtualenv ./venv
./venv/bin/pip install -r requirements.txt

Open crontab

crontab -e

Add the row:

* * * * * cd /home/gravium/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1

Run sentinel manually once to see that it does not throw any errors

SENTINEL_DEBUG=1 ./venv/bin/python bin/sentinel.py

Wait a few minutes and your local wallet should now say ENABLED instead of WATCHDOG_EXPIRED

FINAL WORDS

Hopefully this was helpful, if you need more help have a look in the Gravium discord channel

If this saved your life and/or made you lots of money and you want to thank me feel free to give me a small tip :-)

Gravium address donations : GVCxazDs9ew9ChyzYabx25GpRUindRrKZW

--

--