2018-03-27 13:59:38 -07:00
|
|
|
//! # HoneyBadgerBFT
|
|
|
|
//!
|
2018-03-15 11:00:17 -07:00
|
|
|
//! Library of asynchronous Byzantine fault tolerant consensus known as "the
|
|
|
|
//! honey badger of BFT protocols" after a paper with the same title.
|
2018-03-27 13:59:38 -07:00
|
|
|
//!
|
|
|
|
//! ## Example
|
|
|
|
//!
|
|
|
|
//! The following code could be run on host 192.168.1.1:
|
|
|
|
//!
|
|
|
|
//! ```rust
|
|
|
|
//! extern crate hbbft;
|
|
|
|
//!
|
|
|
|
//! use hbbft::node::Node;
|
|
|
|
//! use std::net::SocketAddr;
|
|
|
|
//! use std::vec::Vec;
|
|
|
|
//!
|
|
|
|
//! fn main() {
|
|
|
|
//! let bind_address = "192.168.1.1:10001".parse().unwrap();
|
|
|
|
//! let remote_addresses = vec!["192.168.1.2:10002".parse().unwrap(),
|
|
|
|
//! "192.168.1.3:10003".parse().unwrap(),
|
|
|
|
//! "192.168.1.4:10004".parse().unwrap(),
|
|
|
|
//! "192.168.1.5:10005".parse().unwrap()];
|
|
|
|
//! let value: &'static str = "Proposed value";
|
|
|
|
//!
|
|
|
|
//! let result = Node::new(bind_address, remote_addresses, Some(value))
|
|
|
|
//! .run();
|
|
|
|
//! println!("Consensus result {:?}", result);
|
|
|
|
//! }
|
|
|
|
//! ```
|
|
|
|
//!
|
|
|
|
//! Similar code shall then run on hosts 192.168.1.2, 192.168.1.3, 192.168.1.4
|
|
|
|
//! and 192.168.1.5, with appropriate changes in `bind_address` and
|
|
|
|
//! `remote_addresses`. Each host has it's own optional broadcast `value`. If
|
|
|
|
//! the consensus `result` is not an error then every successfully terminated
|
|
|
|
//! consensus node will be the same `result`.
|
|
|
|
|
2018-03-29 09:23:02 -07:00
|
|
|
#![feature(optin_builtin_traits)]
|
2018-03-14 17:03:21 -07:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
extern crate protobuf;
|
|
|
|
extern crate ring;
|
|
|
|
extern crate merkle;
|
2018-03-20 09:32:19 -07:00
|
|
|
extern crate crossbeam;
|
2018-04-04 04:49:11 -07:00
|
|
|
#[macro_use]
|
2018-04-02 13:26:40 -07:00
|
|
|
extern crate crossbeam_channel;
|
2018-03-22 15:47:44 -07:00
|
|
|
extern crate reed_solomon_erasure;
|
2018-03-14 17:03:21 -07:00
|
|
|
|
2018-04-01 14:29:12 -07:00
|
|
|
mod connection;
|
2018-04-05 05:09:46 -07:00
|
|
|
mod messaging;
|
2018-03-14 17:03:21 -07:00
|
|
|
mod proto;
|
2018-04-06 08:04:28 -07:00
|
|
|
mod proto_io;
|
2018-03-19 10:12:20 -07:00
|
|
|
mod commst;
|
2018-04-05 05:09:46 -07:00
|
|
|
mod broadcast;
|
|
|
|
mod agreement;
|
2018-03-14 17:03:21 -07:00
|
|
|
|
2018-03-16 11:12:14 -07:00
|
|
|
pub mod node;
|