#raft #consensus #distributed

raft-consensus

Raft consensus algorithm implementation

6 releases (3 breaking)

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

#471 in Algorithms

Download history 30/week @ 2019-12-08 1/week @ 2019-12-15 7/week @ 2019-12-22 17/week @ 2020-01-12 8/week @ 2020-01-19 1/week @ 2020-01-26 3/week @ 2020-02-02 21/week @ 2020-02-09 9/week @ 2020-02-16 64/week @ 2020-02-23 1/week @ 2020-03-01 12/week @ 2020-03-08 6/week @ 2020-03-15 24/week @ 2020-03-22

55 downloads per month

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

~1.1–1.8MB
~35K SLoC