2017 m. rugsėjo 1 d., penktadienis

How to Compile Fedoracoin(Tips) Source Code with linux

This tutorial is outdated, you can download fedoracoin linux version here.

Download fedacoin source:
$ cd
$ git clone https://github.com/fedoracoin-dev/fedoracoin
$ cd fedoracoin/

Fedoracoin(Tips) uses the Berkley DB 4.8, we need to download  and install it.
$ TIPS_ROOT=$(pwd) 
$ BDB_PREFIX="${TIPS_ROOT}/db4"
$ mkdir -p $BDB_PREFIX
$ wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
$ tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
$ ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
$ make install

Compile fedoracoin:
$ cd $TIPS_ROOT

Compiling fedoracoind for server use on Ubuntu (Without GUI):
$ ./autogen.sh ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" -without-gui --without-miniupnpc --disable-tests
With GUI, DONT WORK
$ ./autogen.sh
$ ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" --with-gui=qt5

Configure parameters:
--with-gui=qt5 - By default will compile with qt4
CFLAGS  - C compiler flags
LDFLAGS -  linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>*

Make process may take up to 5-10 mins based on your system
$ make
$ make -s -j5 # To use 5 threads for faster compilation


Other compiling option from feathercoin:

$ make clean
$ ./autogen.sh
$ autoupdate
$ ./configure --with-incompatible-bdb
$ qmake -project

$ make

Files can be found:
/usr/local/bin/fedoracoin-cli - Allows you to send RPC commands to bitcoind from the command line. For example, bitcoin-cli help.
/usr/local/bin/fedoracoind - Is more useful for programming: it provides a full peer which you can interact with through RPCs to port 8332 (or 18332 for testnet).
/usr/local/bin/fedoracoind-qt -  Provides a combination full Bitcoin peer and wallet frontend. From the Help menu, you can access a console where you can enter the RPC commands used throughout this document.


Creating .conf file:
$ nano ~/.fedoracoin/fedoracoin.conf
rpcpassword=change_this_to_a_long_random_password
addnode=90.35.187.174
addnode 90.35.187.174

You should also make the .conf file only readable to its owner"
$ chmod 0600 bitcoin.conf

Fixing compilation problems:

Problem:
$ ./autogen.sh 
./autogen.sh: 3: ./autogen.sh: autoreconf: not found
Solution:
$ sudo apt-get install autoconf autogen

Problem:
configure: error: libdb_cxx headers missing S
Solution:
$ sudo apt-get install libdb++-dev

Problem:
Makefile:921: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:675: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:511: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Solution:
Don't use make -s -j5 option when compling from virtual-box

Problem when compiling with QT:
fatal error: QJsonObject: No such file or directory
Solution:
No solution at the moment

Where qt files are located:
~/fedoracoin $ locate qjsonobject.h
/usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonobject.h
 ~/fedoracoin $ locate qprinter.h
/usr/include/qt4/Qt/qprinter.h
/usr/include/qt4/QtGui/qprinter.h
/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/qprinter.h

Dependencies:
$ sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler -y

Other dependencies:
$ sudo apt-get install autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libtool -y