6 releases (3 breaking)

Uses old Rust 2015

0.4.0 Aug 18, 2018
0.3.0 Jun 3, 2018
0.2.1 May 9, 2018
0.2.0 Apr 15, 2018
0.1.3 Mar 17, 2018

#38 in #consensus-algorithm

MIT license

130KB
3K SLoC

raft-consensus

Pure-rust, network-independent Raft consensus implementation

This is an extraction of consensus and Raft protocol logic, that doesn't depend on network packet representation

Based on original work of Hoverbear


lib.rs:

Raft

This is a crate containing a Raft consensus protocol implementation and encoding/decoding helpers. This is a logic-only crate without any networking part.

To use Raft in it's full strength using this crate, one should do the following:

  • determine and implement(or take ready ones) state machine and persistent log implementations

  • find or make a part responsible for passing peer and client messages over the wire and pass all these messages from to one of ...Consensus structures

  • define a ConsensusHandler with callbacks doing the job for passing messages generated by consensus to other nodes

Dependencies

~2–3MB
~59K SLoC