Compile SolarCoin-Qt 2.1.8. on Raspberry Pi or other SBC

in #utopian-io6 years ago (edited)

What Will I Learn?

  • How to setup your Pi (or other Single Board Computer) ready for compiling
  • How to make the compile and get your SBC/Pi syncing the block-chain

Requirements

  • Raspberry pi 2 or 3 or other SBC with at least 1GB RAM
  • Able to access the terminal from destop or via SSH

Difficulty

  • Intermediate

Tutorial Link

https://github.com/Scalextrix/SolarCoin-Raspberry-Pi-Node/blob/master/GUI-Create-Raspberry-Pi-Node.md

Tutorial Text

Gui-SolarCoin-Raspberry-Pi-Node

Instructions to build a SolarCoin full node on Raspberry Pi, for future proofing SBCs with higher RAM may be needed, for a Rock64 install see https://github.com/jegb/solarcoin-legacy/wiki/Rock64-node

PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH USE OR OTHER DEALINGS.

1 - THIS GUIDE WORKS ON RASPBIAN STRETCH, DOWNLOADS AVAILABLE FROM https://downloads.raspberrypi.org/

You will need to be able to open the command line Terminal either using a screen on the HDMI port with a keyboard and mouse, or via SSH. The guide will compile a version of SolarCoin that has a GUI interface via desktop environment.

For instructions on how to flash an SD card: https://www.raspberrypi.org/documentation/installation/installing-images/

2- Setup Raspbian in the Pi

a) Insert the flashed SD with Raspbian in the Raspberry Pi 2/3.

b) Plug in the USB mouse, the USB keyboard, the HDMI screen, the network cable, and the power cable. You may also SSH to the Raspberry Pi.

The Raspberry Pi will boot for the first time, login with user 'pi' and password 'raspberry'.

sudo raspi-config

You will be presented with the Raspberry Pi Software Configuration Tool (raspi-config). To navigate in this tool, the useful keys are: The up/down arrow, the Enter key, and the Tab key whenever the up/down arrow keys don’t do the job. Here, we will do next things:

b.1) Expand the Filesystem by choosing Option 1, TAB to Finish, and Reboot. You will get a message Root partition has been resized. If you are on SSH your terminal may abort, if this occurs just close the session and login to the Pi again.

b.2) Select your Proper Time Zone and Change the User Password by choosing option 2. Enter your new password twice. When entering the password, the characters won’t be displayed as a security feature. You will get a message Password changed successfully.
After reboot check the time is correct with:

date

b.3) OPTIONAL If you don’t intend to use a display (ie you are on SSH), or output any video media we can free up additional RAM by reducing the amount dedicated to the GPU

sudo raspi-config

Select Advanced Options > Memory Split

Change the entry from 64 to 16

TAB to FINISH and Reboot

b.4) OPTIONAL (not needed if using desktop): If you have a Pi3 with internal Wi-Fi on SSH and would prefer to connect to the Pi via Wi-Fi; then edit the wpa_supplicant.conf file

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add the following lines

network={

ssid="YOURWIFISSID"

psk="YOURWIFIPSK"

}

CTRL+X to save, Y to confirm and then hit Enter

sudo reboot

Disconnect the Ethernet cable and find your new IP address in your Wi-Fi router.

3- Update the Raspberry Pi device.

Run the following commands:

sudo apt-get update

sudo apt-get upgrade -y

4- Setting up the Raspberry Pi for compiling SolarCoin

a- Use the following command to change the default swap size:

sudo nano /etc/dphys-swapfile

Make sure it reads CONF_SWAPSIZE=1024 Use the left/right arrow keys to navigate the file. After change is done, press Ctrl+X followed by Y then Enter key to save the file.
Use the following commands to enable the swap file with its new size:

sudo dphys-swapfile setup

NOTE: This may take a few minutes

sudo dphys-swapfile swapon

You can check the new active swap size with next command:

free -m

Reduce the 'swappiness' so as to only use SWAP when absolutely needed:

sudo nano /etc/sysctl.conf

add

vm.swappiness=1

as the last line then CTRL+X, Y and Enter to save.

b- Install Required Dependencies with next commands:

sudo apt-get install libqrencode-dev libqt5webkit5-dev qt5-qmake libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev-tools libminiupnpc-dev libdb4.8++ libdb5.3++-dev git rng-tools -y

We installed rng-tools to give us really good random number generation entropy, we just need to make one change to the configuration file

sudo nano /etc/default/rng-tools

In the file uncomment (remove the # symbol) from this line

HRNGDEVICE=/dev/hwrng

CTRL+X, Enter & Y to save

sudo reboot

** If you are on SSH you will lose connection, log back in to continue **

5- Clone the SolarCoin Github, compile and install the client / node with following commands:

git clone https://github.com/onsightit/solarcoin-legacy.git

nano solarcoin-legacy/src/net.cpp

Edit the line that reads 'array<int, THREAD_MAX> vnThreadsRunning;'
*TIP; you can search for the line with CRTL+W

make the line so it reads

boost::array<int, THREAD_MAX> vnThreadsRunning;

CTRL+X, Y and ENTER to save the changes

cd solarcoin-legacy

qmake -qt=qt5

make

NOTE: ** This is going to take a long time, go and make a cup of tea **

sudo install -m 755 solarcoin-qt /usr/local/bin/solarcoin-qt

You are done with the terminal window, and can close it, if you are on SSH you now need to start the desktop environment.

6- Start the SolarCoin-Qt by going to the main menu and opening the Run command:

solarcoin-qt

NOTE: Allow the wallet to sync slowly, do NOT use the block-chain snapshot

** Once the block-chain is synced, its advisable to keep regular backups (I do mine monthly) of the SD card image, in this way if you have a hardware or software problem you will be able to get back up and running quickly without re-installing everything, here is a guide: https://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524 **



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it does not follow the Utopian Rules.

  • Contents already shared anywhere else may still be rejected if submitted in Utopian.
  • Contributors should not solicit for any activity in general that it is not strictly accepted by the Utopian Rules (tips).
  • Licensing information is not informative in a tutorial

You can contact us on Discord.
[utopian-moderator]

Hey @laxam, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

I posted in the help on Discord.
However just to be clear:
This is only posted to my GitHub (that is a requirement) and is unique work created yesterday
The Tip is removed, thats standard text on my GitHub for this project
There is no licensing, its a disclaimer of liability

Thanks.

@scalextrix - can you give us an overview of what you're doing here for the non-blockchain types? It looks spectacular - but I'm not sure what it is!

So its a SolarCoin community aim for some time was to make SolarCoin wallets run on ultra-low energy (both vested and in operation) devices like Single Board Computers commonly called Raspberry PIs. The point is that we want the SolarCoin blockchain to operate with minimal energy resources, to maximise the benefit of the solar energy production that SolarCoin wants to incentivise.
Until now we only had a command-line version of a SolarCoin wallet working on a Raspberry Pi, its very difficult for a non-technical person to use.

The above are instructions to install a graphical version of the SolarCoin wallet on a Raspberry Pi (just like you would use on any PC/Mac) opening up the possibility of non-technical users operating SolarCoin on low energy devices. Becasue an SBC can be left operating 24/7/365 at almost no energy cost, this also can strengthen the peer2peer network.

We could even start selling fully operational SolarCoin boxes, with the potential for blockchain energy logging and other features built into a £30 package.
We hope the next evolution will be to get this working on the even smaller Raspberry PI Zero, that is only £5 and uses even less energy, but that is a technical stretch right now and may not be possible.

resteemit done dear
carry on the activity

That's a amazing post...I appreciate your post...
Keep it up...

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @scalextrix I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 63974.07
ETH 3426.40
USDT 1.00
SBD 2.54