Compiling from source
Using make.sh (Debian/Ubuntu only)
By running ./make.sh build will download install required dependencies and run the complete compilation process. Run make install at the end of the process to make the compiled binaries available globally.
Compiling manually
-
Install
gccandboostand other dependecies from your distribution's package manager.Arch Linux
sudo pacman -S gcc boost libevent pythonDebian/Ubuntu
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 curl ibssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev -
Clone the latest version of
ainfrom GitHub.git clone https://github.com/DeFiCh/ain.git cd ain -
Install Berekely DB.
./contrib/install_db4.sh `pwd`Once installation is complete, take note of the commands provided at the end of the build log.
db4 build complete. When compiling defid, run `./configure` in the following way: export BDB_PREFIX='/home/DeFiCha/ain/contrib/db4' ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ... -
Now, run the export command from the DB compilation, then run
autogen.shand finally run the configure command from above.export BDB_PREFIX='/home/DeFiCha/ain/contrib/db4' ./autogen.sh ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" -
We can now compile the node. Run
makein theainroot directory.make # make -j "$(($(nproc)))" # for multicore CPUs
defid and other DeFiChain executables will now be in the src/ directory. You can run make install to access the compiled binaries globally.