stellar-core is the backbone of the Stellar network. It maintains a local copy of the ledger, communicating and staying in sync with other instances of stellar-core on the network. Optionally, stellar-core can store historical records of the ledger and participate in consensus.
C C++ M4 RPC Shell Makefile
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.github fixed formatting in issue template Aug 17, 2018
Builds/VisualStudio Visual Studio project fixes Aug 6, 2018
docs Merge pull request #1671 from MonsieurNicolas/printxdr Aug 9, 2018
lib pad encoded strings in basen.h Apr 25, 2018
m4 switch C++ version to C++14 May 7, 2018
src Merge pull request #1671 from MonsieurNicolas/printxdr Aug 9, 2018
.clang-format updated clang-format file to currently supported format Nov 17, 2017
.dir-locals.el fix build for asio submodule dependency. Mar 5, 2018
.gitattributes fixing the handling of the Peers table (in progress). Feb 21, 2015
.gitignore ignore .vscode folder May 31, 2018
.gitmodules replace hard-coded asio dependency with submodule. Mar 5, 2018
.travis.yml switch travis clang to 5.0 and gcc to 5 May 7, 2018
AUTHORS first cut at automake Dec 1, 2014 added link to performance evaluation May 21, 2018
COPYING Updated COPYING file with links Sep 10, 2015
ChangeLog first cut at automake Dec 1, 2014 Updated docs and configure script to use clang-format-5.0 Nov 17, 2017 updated instructions to use latest version of compiler toolchains May 17, 2018
LICENSE-APACHE.txt Add copyright year and holder name Apr 7, 2015 fix --signtxn so you can specify network to sign for Oct 13, 2016
NEWS Anticipated news! Mar 25, 2015
README fix clean targets so make distcheck works. Jul 15, 2015 move some more content into issue template (from readme) May 21, 2018 fix build for asio submodule dependency. Mar 5, 2018 Use -isystem when including third party header directories Mar 22, 2018 switch C++ version to C++14 May 7, 2018
install-sh autotools Nov 26, 2014
make-mks use same asio defines for lib3rdparty.a and stellar-core. Mar 5, 2018 Minor fixes to performance-eval doc Jun 1, 2018
stellar-core.supp Firm up name of program to 'stellar-core', close #302 Mar 24, 2015 switch travis clang to 5.0 and gcc to 5 May 7, 2018

Build Status


Stellar-core is a replicated state machine that maintains a local copy of a cryptographic ledger and processes transactions against it, in consensus with a set of peers. It implements the Stellar Consensus Protocol, a federated consensus protocol. It is written in C++11 and runs on Linux, OSX and Windows. Learn more by reading the overview document.


Documentation of the code's layout and abstractions, as well as for the functionality available, can be found in ./docs.


See Installation


See Contributing

Running tests

run tests with: src/stellar-core --test

run one test with: src/stellar-core --test testName

run one test category with: src/stellar-core --test '[categoryName]'

Categories (or tags) can be combined: AND-ed (by juxtaposition) or OR-ed (by comma-listing).

Tests tagged as [.] or [hide] are not part of the default test test.

supported test options can be seen with src/stellar-core --test --help

display tests timing information: src/stellar-core --test -d yes '[categoryName]'

xml test output (includes nested section information): src/stellar-core --test -r xml '[categoryName]'

Running tests against postgreSQL

There are two options. The easiest is to have the test suite just create a temporary postgreSQL database cluster in /tmp and delete it after the test. That will happen by default if you run make check.

You can also use an existing database cluster so long as it has databases named test0, test1, ..., test9, and test. To set this up, make sure your PGHOST and PGUSER environment variables are appropriately set, then run the following from bash:

for i in $(seq 0 9) ''; do
    psql -c "create database test$i;"

You will need to set the TEMP_POSTGRES environment variable to 0 in order to use an existing database cluster.

Running tests in parallel

The make check command also supports parallelization. This functionality is enabled with the following environment variables:

  • TEST_SPEC: Used to run just a subset of the tests (default: "~[.]")
  • NUM_PARTITIONS: Partitions the test suite (after applying TEST_SPEC) into $NUM_PARTITIONS disjoint sets (default: 1)
  • RUN_PARTITIONS: Run only a subset of the partitions, indexed from 0 (default: "$(seq 0 $((NUM_PARTITIONS-1)))")
  • TEMP_POSTGRES: Automatically generates temporary database clusters instead of using an existing cluster (default: 1)

For example, env TEST_SPEC="[history]" NUM_PARTITIONS=4 RUN_PARTITIONS="0 1 3" make check will partition the history tests into 4 parts then run parts 0, 1, and 3.

Running stress tests

We adopt the convention of tagging a stress-test for subsystem foo as [foo-stress][stress][hide].

Then, running

  • stellar-core --test [stress] will run all the stress tests,
  • stellar-core --test [foo-stress] will run the stress tests for subsystem foo alone, and
  • neither stellar-core --test nor stellar-core --test [foo] will run stress tests.