Author

Topic: Make your own stakebox. Ultimate beginners guide how to compile any wallet on AA (Read 211 times)

newbie
Activity: 19
Merit: 36
This is universal guide how to run QT wallet or daemon, client. It's just written for beginners, since most of your are probably on the windows, so that switch could be painful

This guide is going to be aim, for people who are not very well versed on Linux, so those of who you are coming from windows. So it will be guide, how to compile your own wallet in AARCH64 platform. ARM64 name was stolen by Apple, but it's basically same architecture, but with uprising of Single Board Computers, like for example Raspberry PI there is way bigger incentive to make your own stake box at fraction of the price and that one which you are going to have full control. This tutorial is not going to look over, how you make your own Rpi more secure, because if you are interested as you should there are far more articles, about that on the internet for actually knowledgable people. So I will skip this and go straight into tutorial. If you guys going to want to know more about how to maybe your Rpi more secure, if it this get enough tracking, I will post it after I consulted it with my friend, who has a job as security architect on Linux based machines.

Again if you are wanted just a deamon and client, this guide is still legit, but you have to use your own expertise when it comes to Linux.

When it comes to consumed electricity, power draw of RPI is negligible and it's way better than to invest in VPS type of services, especially when security is concerned.

Staking also could bring you, in later stage enough coins for masternode and here you are going to have to use static IP, which could be from ISP or by some tunneling network approach, which comes way about this guide.

Everything surrounds this guide revolves around RPI 4B 4GB (at this points is better to get 8GB), RPI 4 still supports in native for 32GB of cards, so buying bigger card only gives you headache and it's not mandator, since you can plug it in your external HW (watch the power consumption and for this type of application, I would suggest self powered ext-HDD.

For those who are in infancy when it comes to linux, I would strongly suggest sticking with "NOOBS" labeled SD cards and Raspbian and to lesser extend Ubuntu, but that's more demanding  system and also not everything could work as intended. So buy your RPI 4B kit, with board, power supply  (5V 2amp is going to suffice, but better to invest in 5V and 3amp, due to peripherals. Also I recommend some case with good ventilation, because Rpi4B can get pretty hot.

For this project to work as intended you need to choose coins which has at least Proof-of-Stake consensus or one of the hybrid opens like PoW/PoS or PoS/MN. For this example I chose News24 coins, because this coins fit the criteria.

This guide can be used from any QT wallet on the market

So let's beginning working on it. I am so far in transition period between Linux and Windows so I am only going to be using tools I trust. One tool. AnyDesk. You can just go ahead with custom VNC server or just plain old text SSH, in that case you can kiss the GUI part of the wallet goodbye, but since you have daemon and client as final product of the compiling process, there is not reason why not use it, if you are well versed with command line type of interacting with electronics.

Bear in mind that everything in Linux is case sensitive!

So first one of the most important thing is to obtain Berkeley 4.3db. this piece of code make sure that wallet.dat is going to be portable across the devices and you are not limited to wallet, which can also be use. If you want extra layer of security, you can use any version of Berkeley db but if you are lost access to the running system or executable of wallet shit the bed, you are all out of luck, because this stuff is configured when compiling the wallet. And you don't want that. I will naively assumed that you are using latest  version of raspbian with many security holes being fixed.

This you can easily do like this by running Terminal (CRTL + ALT + T) and that wrote stuff in code brackets below this point :
Code:
sudo apt-get update
then
Code:
sudo-apt get upgrade -y
Let it run.

So for that Berkeley 3.4db installation to the system, this component cannot not longer be obtained, by sudo apt-get, because it's old package. Worry not, it's a way how to solve it!
I would suggest to cd yourself into Downloads folder, which can easily be done by:
Code:
cd
(this puts you in to home directory)
Code:
cd Downloads

Now for the Berkeley DB 3.4 installation:

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

And let it run, if you don't receive any errors, than you don't need those files, so stay in the folder and type:
Code:
sudo rm db-4.8.30.NC.tar.gz
Code:
sudo rm -r db-4.8.30.NC

We need to keep the junk which we don't need to a minimum.
Seem easy, right? Well we are now prepared to do actually work. It's advisable  to create folder  for Wallets, so you know where you have them. So easily done :
Code:
ls
This shows you in what folder are you in, if you are not satisfied, wrote
Code:
cd /folder/subfolder or /drive/folder wherever you want to have your wallet, could be on Raspbian SD card or somewhere else, like on external HDD that's up to you

No time for require libraries which needed to be installed:

Code:
sudo apt-get install git build-essential libtool autotools-dev autoconf
pkg-config libssl-dev libcrypto++-dev libevent-dev libminiupnpc-dev
libgmp-dev libboost-all-dev devscripts libdb++-dev libsodium-dev
(after prompt, press y and let it run)

Another set:

Code:
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev
qttools5-dev-tools libprotobuf-dev protobuf-compiler libcrypto++-
dev libminiupnpc-dev qt5-default

(after prompt, press y and let it run)

Another additional files:
Code:
sudo apt-get install libzmq3-dev -y

Some wallet's are using older version of libssl1.0-dev so:
Code:
sudo apt-get install libssl1.0-dev - y

After this step DON'T RUN sudo-apt get autoremove because it would wipe this old package!

Next thing we are going to obtain Bitcoin PPA files, which can be done like this.

Code:
cd /etc/apt/sources.list.d/
Code:
sudo nano bitcoin.list

Paste this text in there:
Code:
deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful mai

Then CTRL+X and then y.

Code:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv C70EF1F0305A1ADB9986DBD8D46F45428842CE5E
Code:
sudo apt-get update

////So finally onto the fun stuff and since we choose News24Coin, there are few steps which are exclusive to this coin, which start here////

Code:
mkdir News24
Code:
cd News24

So now we have a folder and we need to clone files from git. Go to github of any project you want and click on that Clone/Download button and copy to clipboard that lip, which is in the pop-up. For News24 it's https://github.com/News24coin/news24coin.git

So to obtain the files it's simply:
Code:
git clone https://github.com/News24coin/news24coin.git

\\\\And here difference between News24Coin and other project ends here\\\\

Not alway created folder from matches the name of the project, so:
Code:
ls

There are going to be listed folders created by git, highlight that folder by cursor and press CRTL + ALT + C

Code:
cd CTRL + SHIFT + V and press enter, now we are at working directory


Sometimes project contains *.sh scripts which are not runnable by default, worry not, there is handy way around it:

Code:
find . -type f -iname "*.sh" -exec chmod +x {} \;

Warning, you have to be in working director, it this case that git created folder

So not to actually compiling.

Code:
./autogen.sh
Code:
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

If you already know where you want to put your compiled binaries, do this:
Code:
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --prefix=/path/to/install

(also in both case watch work warnings, errors, they can occur, if wallet is using some non standard libraries, but worry not, just copy name of what's missing into google, find that package and then: sudo apt-get install and run config above in same format again)

Code:
sudo make
(this could take hours)
Code:
sudo make install

Now if you in configure step mention --prefix, you know where your files are, if you did not, your files are in here:
Code:
cd /usr/local/bin
Code:
ls

And then they are. If that folder only contains files of your crypto wallet, move then is easy:
Code:
sudo mv *

If you have there unrelate files, you are going to have to do that one by one:
Code:
ls

No you can see, what files you want to move and what are you don't want to. Most likely their names is going to have to do with the name of the project.
In terminal list of files in terminal is going to be visible, so copy them by highlighting each file and wrote:

Code:
sudo mv

And do it one by one, till there is not going to be any file linked to the crypto project (it's 4-5 files most often, so not much work)

Go back to folder, when you moved the files and since most of the executable from crypto project is shared library, so double clicking does nothing, we wrote simple script to run then. Be sure that you are in the folder, where are executable:

Code:
sudo nano run.sh

Code:
#!/bin/bash
./news24-qt

Then CRTL + X and y

We make sure that script is runnable just like that:

Code:
sudo chmod +x run.sh

Just double click on run.sh press "execute"

And now you done, you can copy your wallet.dat from other machine, copy the bootstrap and basically from now on it works with standard gui, like you are used to.
--------
Obviously many project have many issues, if you can across one or more of them, let me know by PM or here in thread. I never came across, something which could not be dealt with. Don't be shy. If this lift off, I will write script which do things for you, even for updating wallets with future releases. Cheers and have fun!
Jump to: