git clone https://gitlab.com/zaggprotocol-implementataion/ZaggProtocolCore.git
cd zagg-core
git submodule init
git submodule update
- Type
./autogen.sh
. - Type
./configure
(If configure complains about compiler versions, tryCXX=clang-5.0 ./configure
orCXX=g++-6 ./configure
or similar, depending on your compiler.) - Type
make
ormake -j
(for aggressive parallel build) - Type
make check
to run tests. - Type
make install
to install.
cd lib/bitcoin
./autogen.sh
NOTE: change heap size based on your PC memory
./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=65536" --disable-wallet --without-gui
<< -- OR -->>
./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=65536" --disable-zmq --disable-wallet --without-gui --without-miniupnpc
make -j 8
These are instructions for building stellar-core from source.
For a potentially quicker set up, the following projects could be good alternatives:
- stellar-core in a docker container
- pre-compiled packages
Best is to use the latest stable release that can be downloaded from https://github.com/stellar/stellar-core/releases
Alternatively, branches are organized in the following way:
branch name | description | quality bar |
---|---|---|
master | development branch | all unit tests passing |
testnet | version deployed to testnet | acceptance tests passing |
prod | version currently deployed on the live network | no recall class issue found in testnet and staging |
For convenience, we also keep a record in the form of release tags of the versions that make it to production:
- pre-releases are versions that get deployed to testnet
- releases are versions that made it all the way in prod
- c++ toolchain and headers that supports c++14
clang
>= 5.0g++
>= 6.0
pkg-config
bison
andflex
libpq-dev
unless you./configure --disable-postgres
in the build step below.- 64-bit system
clang-format-5.0
(formake format
to work)pandoc
perl
You will have to install the test toolchain in order to both build and run stellar-core.
Just like 14.04, you can install the test toolchain to build and run stellar-core.
Alternatively, if you want to just depend on stock 16.04, you will have to build with clang and have use libc++
instead of libstdc++
when compiling.
After installing packages, head to building with clang and libc++.
# NOTE: newer version of the compilers are not
# provided by stock distributions
# and are provided by the /test toolchain
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
# common packages
sudo apt-get install git build-essential pkg-config autoconf automake libtool bison flex libpq-dev
# if using clang
sudo apt-get install clang-5.0
# clang with libstdc++
sudo apt-get install gcc-6
# if using g++ or building with libstdc++
# sudo apt-get install gcc-6 g++-6 cpp-6
# optional: pandoc (to compile man pages)
sudo apt-get install pandoc
In order to make changes, you'll need to install the proper version of clang-format.
In order to install the llvm (clang) toolchain, you may have to follow instructions on https://apt.llvm.org/
sudo apt-get install clang-format-5.0
When building on OSX, here's some dependencies you'll need:
- Install xcode
- Install homebrew
- brew install libsodium
- brew install libtool
- brew install automake
- brew install pkg-config
- brew install libpqxx (If ./configure later complains about libpq missing, try PKG_CONFIG_PATH='/usr/local/lib/pkgconfig')
- brew install pandoc
You may need to link few of the packages manually to avoid errors.
On some systems, building with libc++
, LLVM's version of the standard library can be done instead of libstdc++
(typically used on Linux).
NB: there are newer versions available of both clang and libc++, you will have to use the versions suited for your system.
You may need to install additional packages for this, for example, on Linux Ubuntu:
# install libc++ headers
sudo apt-get install libc++-dev libc++abi-dev
Here are sample steps to achieve this:
export CC=clang-5.0
export CXX=clang++-5.0
export CFLAGS="-O3 -g1 -fno-omit-frame-pointer"
export CXXFLAGS="$CFLAGS -stdlib=libc++ -isystem /usr/include/libcxxabi"
git clone https://github.com/stellar/stellar-core.git
cd stellar-core/
./autogen.sh && ./configure && make -j6