Do it Yourself!

Compile Blackcoin-More

It is a good thing to compile crypto wallets yourself. Maybe it seems difficult, but it is not that hard..

It is a good thing to compile crypto wallets yourself. Maybe it seems difficult, but it is not that hard.

Basically you can use a minimum desktop installation and follow this guide. Let’s do it!

Because Blackcoin More is a Bitcoin fork, most of the dependencies for packages is explained here: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md

The Berkeley DB version for More is not version 4.8.30, but version 6.2.32. So in this tutorial we are going to use a that DB version.

Install some packages:$

First the packages to build the daemon

~$ sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-all-dev libminiupnpc-dev libzmq3-dev git

Then the packages to build the QT5 GUI

~$ sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev

Some manual file creation:

Create a new directory inside your home folder, called “development” and change to the directory.

~$ mkdir -p development
~$ cd development/

Now we download the correct Berkeley DB version for Blackcoin More and following the following steps to compile it

~/development$ wget https://download.oracle.com/berkeley-db/db-6.2.32.NC.tar.gz
~/development$ tar -xvf db-6.2.32.NC.tar.gz
~/development$ cd db-6.2.32.NC/build_unix
~/development/db-6.2.32.NC/build_unix$ mkdir -p build
~/development/db-6.2.32.NC/build_unix$ BDB_PREFIX=$(pwd)/build
~/development/db-6.2.32.NC/build_unix/ ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX
~/development/db-6.2.32.NC/build_unix$ sudo make install
~/development/db-6.2.32.NC/build_unix$ cd ../..

You are now back in the ~/development$ directory and ready to download Blackcoin More from Gitlab. the Official version can be found here: https://gitlab.com/blackcoin/blackcoin-more

The following command will download the source code from gitlab into a directory called blackcoin-more. after this is done, just change directory to blackcoin-more

~/development$ git clone https://gitlab.com/blackcoin/blackcoin-more.git

Cloning into 'blackcoin-more'...
remote: Enumerating objects: 74810, done.
remote: Counting objects: 100% (74810/74810), done.
remote: Compressing objects: 100% (20067/20067), done.
remote: Total 74810 (delta 57158), reused 71987 (delta 54344)
Receiving objects: 100% (74810/74810), 44.64 MiB | 3.07 MiB/s, done.
Resolving deltas: 100% (57158/57158), done.

~/development$ cd blackcoin-more/

Now it is time to generate the config files and also configure the source code. this way we can compile it and create some binaries.

Note: “ make -j2” will use 2 CPU cores.

~/development/blackcoin-more$ ./autogen.sh
~/development/blackcoin-more$ ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --disable-tests --disable-bench --enable-reduce-exports
~/development/blackcoin-more$ make -j2

You might see some warnings, don’ t worry. You will seen something similar to this at the end:

  AR       libbitcoin_wallet.a
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
  CXXLD    blackmored
  AR       qt/libbitcoinqt.a
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
  OBJCXXLD qt/blackmore-qt
make[2]: Leaving directory '~/development/blackcoin-more/src'
make[1]: Leaving directory '~/development/blackcoin-more/src'
make[1]: Entering directory '~/development/blackcoin-more'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '~/development/blackcoin-more'

Done! you will have 4 files. 3 files in src/ directory and 1 file in src/qt/ directory. Lets check that:

~/development/blackcoin-more$ cd src/
~/development/blackcoin-more/src$ ls -lh blackmored blackmore-*
-rwxr-xr-x 1 user user 7,2M feb 11 12:30 blackmore-cli
-rwxr-xr-x 1 user user  97M feb 11 12:31 blackmored
-rwxr-xr-x 1 user user  17M feb 11 12:30 blackmore-tx

~/development/blackcoin-more/src/qt$ ls -lh blackmore-qt 
-rwxr-xr-x 1 user user 139M feb 11 12:32 blackmore-qt

To test it. Just run the blackmore-qt binary with the -version switch.

~/development/blackcoin-more/src/qt$ ./blackmore-qt -version

Blackcoin More version v2.13.2.1-2a9903cef (64-bit)
Copyright (C) 2009-2018 The Bitcoin Core Developers
Copyright (C) 2014-2018 The Blackcoin Developers
Copyright (C) 2018-2018 The Blackcoin More Developers

Please contribute if you find Blackcoin More useful. Visit
<http://blackcoin.org/> for further information about the software.
The source code is available from
<https://gitlab.com/blackcoin/blackcoin-more>.

I do this test, just to make sure that all went well. I use the version-build numbers for a new folder, and I copy the 4 files into that directory

As you can see the files are big. We are going to “strip” some debug symbols of them. Just go to the directory and use the following command.

~/development/v2.13.2.1-2a9903cef$ strip blackmore*

Now the binaries are a lot smaller.

That is it! just run your binary!

~/development/v2.13.2.1-2a9903cef$ ./blackmore-qt

If you are satisfied with the result, you can cleanup the source code and wait for the next wallet update. I will go into wallet updates in another blog!

~/development/blackcoin-more$ make clean
Making clean in src
make[1]: Entering directory '~/development/blackcoin-more/src'
make[2]: Entering directory '~/development/blackcoin-more/src'
 rm -f blackmored blackmore-cli blackmore-tx qt/blackmore-qt
test -z "crypto/libbitcoin_crypto.a libbitcoin_util.a
<snip>
rm -rf .libs _libs
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ Blackmore-Qt.app
rm -rf qa/pull-tester/__pycache__
rm -f *.lo
make[1]: Leaving directory '~/development/blackcoin-more'

If you like this article and want to buy me a beer, you can use your own compiled wallet to send me some BLK on address: BCnEWSuGGdNyv5z6ZkSkmGNCHua5CVxEtv

Note! Blackcoin More is a continuation of Janko’s Blackcoin Lore wallet. If you run it the first time, you can choose either to use the defaults or to use an existing (Lore) data directory. I suggest, that you use the defaults and sync the blockchain again.

The latest Bootstrap file can always be found here: https://mega.nz/#F!ru5lTJSD!3Ysa0Whk4Nyztc9xfu8pjQ .

Place the bootstrap.dat file inside a directory called ~/.blackmore$ and choose defaults at startup