Search Knowledge Base ...

Need Support?

Can't find the answer you're looking for? Don't worry our awesome community is here to help!

Compilation

Compile the Cloakcoin Client

This guide cover the compilation of CloakCoin on Linux and Raspberry Pi, it has been tested by Cloak Team members on Ubuntu 16.04, Xubuntu 16.04 LTS and Raspberry Pi3, different Linux distributions may need additional tweaking.

Build instructions on Ubuntu 16.04/18.04

⚠️ Because of missing libcurl3 on Ubuntu 18.04 you will need to follow these instructions ⚠️

Please download and paste the bootstrap/blockchain file manually!

  1. Download the updated package list from the repositories
    sudo apt update

  2. Upgrade your installation
    sudo apt upgrade -y

  3. Install the necessary dependencies
    sudo apt install -y build-essential qt5-default qt5-qmake qttools5-dev-tools libleveldb-dev libboost1.58-dev libcurl4-openssl-dev openssl libssl-dev libdb++-dev libevent-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev

  4. Create directory for dependency and set permissions
    sudo mkdir /opt/deps

    sudo chown $USER /opt/deps

  5. Download OpenSSL
    cd /opt/deps

    wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz

  6. Decompress OpenSSl
    tar -zxf openssl-1.0.2k.tar.gz

    cd openssl-1.0.2k

  7. Build OpenSSL
    ./config

    make

  8. Create symbolic link
    cd ..

    ln -s openssl-1.0.2k openssl-1.0.2g

  9. Download the CloakCoin Client - Find the latest version here: https://github.com/CloakProject/CloakCoin/releases/
    cd ~

    wget -O https://github.com/CloakProject/CloakCoin/archive/refs/tags/VERSION.tar.gz

    tar xvfz CloakCoin-VERSION.tgz

  10. Build the CloakCoin Client
    cd CloakCoin-VERSION/src/leveldb

    make clean

    make

    cp out-static/*.a .

    cd ../..

    qmake USE_UPNP=-

    make

Build instructions for Ubuntu Linux QT GUI edition

  1. Install git if you don't already have it
    sudo apt install git

  2. Clone the CloakCoin repository from GitHub
    git clone https://github.com/CloakProject/CloakCoin

    cd CloakCoin/src

  3. Install the dependencies
    sudo apt install -y \ build-essential \ qt5-default \ qt5-qmake \ libleveldb-

    dev \ libboost1.58-dev \ libcurl4-openssl-dev \ openssl \ libssl-dev \

    libdb++-dev \ libevent-dev \ libboost-dev \ libboost-system-dev \

    libboost-filesystem-dev \ libboost-program-options-dev \ libboost-thread-dev \

    libminiupnpc-dev

  4. Build from source
    qmake && make

  5. If all went well your cloakcoin-qt should now have been created in the root of the repository folder
  6. The first time you launch the wallet, it will have to sync with the network. This takes forever if you don't already have downloaded the blockchain downloaded. You can download it beforehand like this:
    mkdir ~/.CloakCoin && cd ~/.CloakCoin

  7. Download CloakCoin blockchain data

    ⚠️CloudFlare’s DDoS protection could block wget command!⚠️ - Please download and paste the cloak_ldb.zip file manually!

    wget https://backend.cloakcoin.com/wallet/v2/cloak_ldb.zip

    unzip cloak_ldb.zip

    rm cloak_ldb.zip

  8. Now you are ready to launch the wallet
    ./cloakcoin-qt

  9. You can optionally copy cloakcoin-qt to a directory in your $PATH so that you can open it from anywhere like

    sudo cp ./cloakcoin-qt /usr/local/bin



Build instructions for Linux headless edition

  1. Install git if you don't already have it
    sudo apt install git

  2. Clone the CloakCoin repository from GitHub
    git clone https://github.com/CloakProject/CloakCoin

    cd CloakCoin/src

    make -f makefile.unix



Build instructions for the Raspberry Pi 3 headless edition

This guide covers everything you need to know to set up a portable staking wallet and enigma anonymous transactions node. If you follow the steps by the order you should end up with a working CloakCoin wallet and have at the palm of your hand the power to support the CloakCoin network.

Prerequisites:

  1. Raspberry Pi3
  2. 8GB SD card (class 10 recomended)
  3. Power supply 5v 2A
  4. 2GB USB stick for swap drive (USB 3.0 recommended)
  5. LAN internet connection


Install a arm64 OS on the Raspberry Pi and setup a SWAP partition on a USB drive

Pi64 is a 64-bit OS for the Raspberry Pi 3. It is based on Debian Stretch and backed by a 4.11 Linux kernel.

  1. Download pi64 lite from: https://github.com/bamarni/pi64/releases/download/2017-07-31/pi64-lite.zip
  2. To write the Pi64 image into the SD card, we are going to use Etcher, download etcher for your platform here: https://etcher.io
  3. Execute Etcher, then click on 'select image' and select the Pi64 image you downloaded earlier, then 'select drive' for the SD card you are going to use on the Pi, then click 'Flash!'. Wait for the 'flash completed!' message and then you have the SD card ready to use on the Raspberry Pi.
  4. Insert the SD card on the Raspberry Pi and power it up. During the first boot the installation process will continue for a few minutes, then the Raspberry Pi will reboot and you'll be ready to go. The default user is pi and its password raspberry, it has passwordless root privileges escalation through sudo. On the lite version, SSH is enabled by default.
  5. Change the pi user password by issuing the command:
    passwd

  6. Update Pi64 packages lists by typing:
    sudo apt-get update

  7. Install a text editor:
    sudo apt-get install nano

  8. To create a swap partition on the USB drive, create an empty partition that should have no holes. You can then format this partition with:
    sudo mkswap /dev/sdX

    replacing /dev/sdX with your partition (type the command

    dmesg

    to identify your USB drive, on my case it is sda1).

  9. Mount this partition as swap with:
    sudo swapon -U UUID

    where UUID is that of your /dev/sdX as read from this:

    sudo blkid /dev/sdX

    Bind your new swap in /etc/fstab by editing fstab with:

    sudo nano /etc/fstab

    Adding this line (replace xxx with the UUID of your sdX):

    UUID=xxx none swap sw 0 0

  10. Reboot the system with:
    sudo reboot

  11. To vizualize the newly added swap partition type:
    free -h



Setup the building environment

  1. Install the dependencies and required apps by issuing the following commands:
    sudo apt-get update

    sudo apt-get install g++

    sudo apt-get install zlib1g-dev

    sudo apt-get install wget

    sudo apt-get install unzip

    sudo apt-get install make

    sudo apt-get install libboost-all-dev

    sudo apt-get install git

  2. Get the CloakCoin source:
    git clone https://github.com/CloakProject/CloakCoin

    This will clone the CloakCoin Project source to your machine. If you are in your home directory (by default /home/pi) it will clone to: /home/pi/CloakCoin

  3. Get and compile libevent
    sudo wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

    tar -zxf libevent-2.0.21-stable.tar.gz

    cd libevent-2.0.21-stable

    ./configure

    make

    sudo make install

  4. Get and compile libssl from source
    wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz

    tar -zxf openssl-1.0.2k.tar.gz

    cd openssl-1.0.2k

    ./config

    make

    sudo make install_sw

    echo libssl-dev hold | sudo dpkg --set-selections

    (keeps from updating)

  5. Get and compile Berkeley db 4.8
    wget http://ftpmirror.your.org/pub/misc/Berkeley-DB/db-4.8.30.zip

    unzip db-4.8.30.zip

    cd db-4.8.30/build_unix

    ../dist/configure --build=aarch64-unknown-linux-gnu --enable-cxx

    make

    sudo make install

  6. Compile levedb
    cd /home/pi/CloakCoin/src/leveldb

    chmod 755 build_detect_platform

    make clean

    make

    (ignore compile error, the *.a files have already been created)

    cp out-static/*.a .

  7. Get and compile miniupnpc 1.9
    wget http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.9.20160209.tar.gz

    tar -zxf miniupnpc-1.9.20160209.tar.gz

    cd miniupnpc-1.9.20160209

    make

    copy libminiupnpc.a to (cloaksource)/src/miniupnpc with:

    cp libminiupnpc.a /CloakCoin/src/miniupnpc



Compile the wallet

  1. Change to CloakCoin source directory and compile:
    cd /home/pi/CloakCoin/src

    export CXXFLAG=" -DBOOST_NO_CXX11_SCOPED_ENUMS"

    make -f makefile.unix

    You should end up with cloakcoind in /home/pi/CloakCoin/src (grab a cup of coffee, it will take over an hour to complete). On completion do:

    cp ./cloakcoind /usr/local/bin



Initialization, Testing and First Commands

  1. Before you start the wallet you need to open a text editor and create CloakCoin's rpc configuraion file with:
    nano /home/pi/.CloakCoin/CloakCoin.conf

  2. Write the following info:
    rpcuser=bitcoinrpc

    rpcpassword= <type some ramdom password that you dont need to remember>

    Press Ctrl + O then Enter to save, then Ctrl + X to exit the text editor.

  3. Set it to owner-readable-only with:
    chmod 400 /home/pi/.CloakCoin/CloakCoin.conf

    (If you fail to create the above CloakCoin.conf file, when starting the wallet with the command cloakcoind you will receive the following error:

    you must set rpcpassword=<password> in the configuration file: ...

  4. To start the wallet with the database cache limited to 100MB type:
    cloakcoind -dbcache=100

  5. Open another console by pressing Alt + F2 and typing:
    cloakcoind getinfo

    if you get the response: error: couldn't connect to server Wait a few minutes and try again, as soon as you get a response your CloakCoin Pi wallet is up and running, and its a matter of waiting for the connections to come up and the syncing to start.

  6. Synchronizing with the blockchain can take several days, it's faster if you download the blockchain data manually:

    ⚠️CloudFlare’s DDoS protection could block wget command!⚠️ - Please download and paste the cloak_ldb.zip file manually!

    cd /home/pi/.CloakCoin

    wget https://backend.cloakcoin.com/wallet/v2/cloak_ldb.zip

    unzip cloak_ldb.zip

    rm cloak_ldb.zip

  7. Reboot:
    sudo reboot

  8. Start wallet again:
    cloakcoind -dbcache=100

  9. To get the full list of rpc commands type:
    cloakcoind help



Backup SD card image

It's sensible to keep a copy of the entire SD card image, so you can restore the card if you lose it or it becomes corrupt.

Of course make sure your wallet is encrypted, before making the backup.

  1. To create a backup image file on your computer type:
    sudo dd bs=4M if=/dev/sdb of=cloakpi.img

  2. To restore the image file to another SD card type:
    sudo dd bs=4M if=cloakpi.img of=/dev/sdb



Back

WAS THIS ARTICLE HELPFUL?

 4
 0