Skip to content

mawentao007/paxos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibPaxos

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 (see 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.

Libevpaxos (see libpaxos/evpaxos) is the actual networked Paxos implementation. This library is built on top of the libpaxos and libevent.

Building

These are the basic steps required to get and compile libpaxos

git clone https://bitbucket.org/sciascid/libpaxos.git
mkdir libpaxos/build
cd libpaxos/build
cmake ..
make

LibPaxos3 depends on Berkeley Berkeley DB and libevent. Berkeley DB can be disabled in favor of an in-memory storage (see build options below).

LibPaxos3 has been tested on Linux and OS X.

Useful build options

You pass options to cmake as follows: cmake -DOPTION=VALUE

  • BDB_ROOT=PATH - point it to your installation of Berkeley DB
  • LIBEVENT_ROOT=PATH - point it to your installation of Libevent
  • USE_MEM_STORE=ON - enables in-memory storage, instead of Berkeley DB
  • BUILD_UNIT=ON - enables unit tests - see section below

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

Configuration

See paxos.conf for a sample configuration file.

Unit tests

Unit tests depend on the Google Test library. First enable unit tests run

cmake -DBUILD_UNIT=ON ..
make

Execute the tests using make test, or, run ./unit/gtest for detailed output.

Feedback

LibPaxos project page

LibPaxos3 repository

Mailing list

License

Libpaxos is distributed under GPL version 3.

LibPaxos3 has been developed at the University of Lugano, by Daniele Sciascia.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published