This is LibPaxos3! A complete rewrite of LibPaxos2.
LibPaxos3 has been improved in the following aspects:
- Doesn't make use of multicast
- Has a cleaner design
- Has a better build system based on CMake
- Comes with unit tests
LibPaxos3 is divided in two libraries: libpaxos and libevpaxos.
libpaxos/paxos) implements the core of the Paxos consensus
protocol, and is not cluttered with network specific code. That is, libpaxos
does not depend on any particular networking library.
libpaxos/evpaxos) is the actual networked Paxos
implementation. This library is built on top of the libpaxos and libevent.
These are the basic steps required to get and compile LibPaxos3
git clone https://bitbucket.org/sciascid/libpaxos.git mkdir libpaxos/build cd libpaxos/build cmake .. make
LibPaxos3 should compile on Linux and OS X.
Useful build options
You pass options to cmake as follows:
LMDB_ROOT=PATH- point it to your installation of LMDB
LIBEVENT_ROOT=PATH- point it to your installation of Libevent
MSGPACK_ROOT=PATH- point it to your installation of MessagePack
Running the examples
cd libpaxos/build ./sample/acceptor 0 ../paxos.conf > /dev/null & ./sample/acceptor 1 ../paxos.conf > /dev/null & ./sample/proposer 0 ../paxos.conf > /dev/null & ./sample/learner ../paxos.conf > learner.txt & ./sample/client 127.0.0.1:5550 1
paxos.conf for a sample configuration file.
Unit tests depend on the Google Test library. Execute the tests using
make test in your build directory, or run
build/unit for detailed output.