How to setup a Globalcoin node on a Raspberry pi
This document will show you how to setup a staking wallet for globe on a raspberry pi. Disclaimer: While this worked for me, use at your own risk. I am not responsible for your coins.
Flash your raspberry pi with the raspbian os
Boot your pi for the first time
For initial setup you will need:
- Usb keyboard
- Monitor w/hdmi cable
- Micro usb power source
After initial setup we will run it headless so you won’t need a monitor or keyboard attached.
Connect the hdmi and keyboard and plug in the power. Once it boots you can login with the default login:
- User: pi
- Password: raspberry
Setup initial configuration
First, we will need to do some initial setup. to do that, bring up the config menu with the following command
You should see a menu that looks like this
Perform initial configuration in raspberry pi config menu
you will want to set the following configuration options on your raspberry pi
1 - change user password for the current user change your defult password for the pi login 2 - change hostname name your raspberry pi whatever you like 4 - localisation options I1 - change locale The pi comes setup for a British UTF-8, to change this to a US UTF-8: remove en_gb.utf-8 add en_us.utf-8 (en_us.utf-8) Or change it to the UTF_8 of your choice I2 - change timezone use your timesone I3 - change keyboard layout english (us) defaults or whatever you use For standard US keyboard select 1) Generic 105-key (Intl) PC 2) Other 3) English (US) 4) English (US) 5) The default for the keyboard layout 6) No compose key I4 - change wi-fi country set it to your country 5 - interfacing options P2 - ssh (enable) 7 - advanced options A1 - expand filesystem A3 - memory split change from 64 -> 16
Select finish from the menu
Reboot if it doesn’t automatically
Increase your swapfile size
login with pi/(new password)
Change conf_swapsize=100 to conf_swapsize=2000
Update your swapfile to the new 2gb size
Add to the bottom of file:
Turn on wifi
If you have the Raspberry Pi 3, you have built in wifi, you just need to turn it on.
Add the following to the bottom of the file: /etc/network/interfaces
Once rebooted, login with pi/(new password)
Test network with
Note: you can use crtl+c to stop pinging
Add your user
You can use your own username, i used jproto. substitute whatever your username is for jproto in the following commands.
Shutdown your pi, you should now be able to ssh into your pi so you can unplug the monitor and keyboard and move it to a location is that out of the way.
SSH into your pi
Find your ip address
After powering on your raspberry pi, you will need to login to your router to find the ip address of your pi.
You can likely use your web browser and go to 192.168.0.1, but this differs based on your router. you may need to Google for your router’s specific details.
Note: if your router allows you to set the ip address of your pi to the same address, this is preferred. alternatively you can configure your pi with a static ip address, but that is outside the scope of this tutorial.
Ssh into your pi
Once you know the ip address of your pi you can log in from the ssh client of your local pc
Update the software
once logged into your pi you should update the software.
Setup firewall and rsa key login
Take thes steps to improve the security of your pi.
We will want to improve security by disabling password based authentication and moving to key based authentication.
After that, we will setup a firewall
Using key based authentication
Here is a good tutorial on how to setup key based auth in linux link. You can ignore the part about setting up a user and we will cover ufw below.
We will use ufw as a firewall. to do this we need to
- install ufw
- allow ssh connections to the raspberry pi
- enable the firewall
Install dependencies for wallet
Many of the dependencies can be installed through our package manager. However, a few need a specific version that is not available through the repositories, we will build those from source.
Install what we can from the repository
Install berkeley db
The globe wallet uses version 4.8 of the berkeley database so we’ll need to download, build, and install that.
First let’s make a directory for the source
Download the berkeley database source code, unzip it, then build the berkeleydb.
The version of Open SSL in Raspbian Stretch is not currently compatable with boost. We need to compile a compatable version
Issue detail: [openssl issue - openssl-1.1.1 is not compatible with boost] (https://github.com/bitshares/bitshares-core/wiki)
Download and install open ssl 1.0.2
Note: If this incompatability is fixed in the future, you can just install libssl-dev from the repository
Download wallet source
We are now ready to build the wallet, let’s pull down the source code
I had issues with building the packaged leveldb and had to build it myself. You can do this with the following series of commands.
Make the config file
Create the file ~/.global/global.conf
Note: replace the value for rpcpassword with your own value, make it a strong password as this allows access to your coins.
Restrict access to global.conf
Add bin to your path
This will allow us to run scripts in ~/bin from any directory
Add this to the bottom of the file
Now reload bashrc
Start the node
Check to make sure that you have connections and the blockchain is loading
Find some node addresses here link You can include these in your config file using addnode if you are not getting connections
You will want to encrypt your wallet, you can do this from the command line.
Create your own passprhase to replace the fake one below. Don’t forget it! if you do, you will be unable to stake or remove coins from the wallet.
This will encrypt and stop the wallet. While it is stopped, make a copy so you can grab it (via sftp) as a backup and store it in a safe place.
Restart and test wallet
Now restart the wallet and make sure you can unlock it.
If this all worked, make sure you safely save your wallet.dat and passphrase somewhere. if you lose them you will lose access to your coins.
It is also a good idea to regularly back up your wallet.dat file.
Unlock your wallet for staking
Now you need to unlock your wallet for staking. Do this by unlocking and setting the last parameter as true
If this worked you should see a value other than -1 for unlocked_until when you getinfo
You can check on staking status with
Since your passphrase is in your bash history, it is good to clear it with:
The following references were very helpful in setting this up, you may find them helpful too
- Globe unix build doc
- Raspnode for litecoin
- Litecoin command line api
- Building a staking stratis raspberry pi node - This has some useful automation info for automatically updating your pi
- Raspberry pi
- How to use nano
- Bash guide for beginners
- How to use sftp
- Raspberry pi
You can also get a list of wallet commands with