Compilar o Cliente CloakCoin

From CloakCoin Wiki
Jump to: navigation, search
This page is a translated version of the page Compile the Cloakcoin Client and the translation is 45% complete.

Other languages:
English • ‎Tiếng Việt • ‎Türkçe • ‎español • ‎português • ‎中文(中国大陆)‎

Este guia cobre a compilação da CloakCoin no Linux e no raspberry Pi, foi testado pelos membros da equipe Cloak no Ubuntu 16.04, Xubuntu 16.04 LTS e raspberry Pi3, diferentes distribuições do Linux podem precisar de ajustes adicionais.











Compilar o Cliente 2.2.2.1 em Ubuntu 16.04

  1. Baixe a lista de pacotes atualizada
  2. sudo apt update
  3. Atualize sua instalação
  4. sudo apt upgrade -y
  5. Instale as dependencias necessárias
  6. 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
  7. Crie um diretório para depêndencia e defina permissão
  8. sudo mkdir /opt/deps
    sudo chown $USER /opt/deps
  9. Baixe o OpenSSL
  10. cd /opt/deps
    wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
  11. Descompacte o OpenSSL
  12. tar -zxf openssl-1.0.2k.tar.gz
    cd openssl-1.0.2k
  13. Compile o OpenSSL
  14. ./config
    make
  15. Crie uma ligação simbolica
  16. cd ..
    ln -s openssl-1.0.2k openssl-1.0.2g
  17. Baixe o Cliente CloakCoin
  18. cd ~
    wget -O CloakCoin-2.2.2.1.tgz https://github.com/CloakProject/CloakCoin/archive/v2.2.2.1.tar.gz
    tar xvfz CloakCoin-2.2.2.1.tgz
  19. Compile o Cliente CloakCoin
  20. cd CloakCoin-2.2.2.1/src/leveldb
    make clean
    make
    cp out-static/*.a .
    cd ../..
    qmake USE_UPNP=-
    make

Instruções para build da edição Ubuntu Linux QT

  1. Instale o git se ainda não o tiver
  2. sudo apt install git
  3. Clone o repositório da CloakCoin desde o GitHub
  4. git clone https://github.com/CloakProject/CloakCoin
    cd CloakCoin/src
  5. Instale as dependencias
  6. 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
  7. Compile desde o código fonte
  8. qmake && make
  9. Se tudo correu bem você deverá ter o aplicativo cloakcoin-qt na raiz da pasta do repositório
  10. A primeira vez que você iniciar a carteira, terá que sincronizar com a rede. Isso pode levar muito tempo se você ainda não tem a blockchain baixada. Você pode baixá-la manualmente fazendo:
  11. mkdir ~/.CloakCoin && cd ~/.CloakCoin
  12. Download ~1.1 GB de dados da blockchain
  13. wget https://backend.cloakcoin.com/wallet/v2/cloak_ldb.zip
    unzip cloak_ldb.zip
    rm cloak_ldb.zip
  14. Agora você está pronto para abrir a carteira
  15. ./cloakcoin-qt
  16. Você pode, opcionalmente, copiar o cloakcoin-qt para um diretório em seu $ PATH para que possa abri-lo de qualquer lugar
  17. sudo cp ./cloakcoin-qt /usr/local/bin

Instruções para compilar a edição Headless Linux

  1. Instale o git se ainda não o tiver
  2. sudo apt install git
  3. Clone o repositório CloakCoin desde o GitHub
  4. git clone https://github.com/CloakProject/CloakCoin
    cd CloakCoin/src
    make -f makefile.unix

Instruções para compilar a edição Raspberry Pi 3 Headless

Este guia abrange tudo o que você precisa saber para configurar uma carteira de stake e um nó de transações anônimas enigma portátil.


Se você seguir os passos por ordem, você terá uma carteira CloakCoin em funcionamento e terá na palma da sua mão o poder de suportar a rede CloakCoin.

Pré-requisitos

  1. Raspberry Pi 3
  2. Cartão 8Gb SD (recomendado um class 10)
  3. Fonte de alimentação 5V 2A
  4. Pen USB 2Gb para partição SWAP( Recomendado USB 3.0)
  5. Ligação internet cabeada
  6. Café


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

Pi64 is an 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 donwloaded 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 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 enviroment

  1. Install the dependencies and required apps by issuing the following commands:
  2. 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
  3. Get the CloakCoin source:
  4. 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

  5. Get and compile libevent
  6. 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
  7. Get and compile libssl from source
  8. 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 (no docs/manpages)
    echo libssl-dev hold | sudo dpkg --set-selections (keeps from updating)
  9. Get and compile Berkeley db 4.8
  10. 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
  11. Compile levedb
  12. 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 .
  13. Get and compile miniupnpc 1.9
  14. 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 libminupnpc.a /home/pi/CloakCoin/src/miniupnpc



Compile the wallet

  1. Change to CloakCoin source directory and compile:
  2. 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



Inicialization, 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:
  2. nano /home/pi/.CloakCoin/CloakCoin.conf
  3. Write the following info:
  4. 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.

  5. Set it to owner-readable-only with:
  6. 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: ...')

  7. To start the wallet with the database cache limited to 100Mb type:
  8. cloakcoind -dbcache=100
  9. Open another console by pressing Alt + F2 and type:
  10. cloakcoind getinfo

    if you get the response: error: couldnt 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.

  11. Sinchronizing with the blockchain can take several days, its faster if you download the blockchain data manually:
  12. cd /home/pi/.CloakCoin
    wget https://backend.cloakcoin.com/wallet/v2/cloak_ldb.zip
    unzip cloak_ldb.zip
    rm cloak_ldb.zip
  13. Reboot:
  14. sudo reboot
  15. Start wallet again:
  16. cloakcoind -dbcache=100
  17. To get the full list of rpc commands type:
  18. 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. Para criar um arquivo de imagem de backup no seu computador:
  2. sudo dd bs=4M if=/dev/sdb of=cloakpi.img
  3. Para restaurar o arquivo de imagem para outro cartão SD, faça:
  4. sudo dd bs=4M if=cloakpi.img of=/dev/sdb


É isso aí, divirta-se!


C0.png
Livre de Restrições de Copyright.