hashgraph_like_consensus/
lib.rs

1//! A lightweight consensus library for making binary decisions in P2P networks.
2//!
3//! This library implements the [Hashgraph-like Consensus Protocol](https://github.com/vacp2p/rfc-index/blob/main/vac/raw/consensus-hashgraphlike.md),
4//! which lets groups of peers vote on proposals and reach agreement even when some peers are
5//! unreliable or malicious. It's designed to be fast (O(log n) rounds), secure (Byzantine fault
6//! tolerant), and easy to embed in your application.
7//!
8//! ## How it works
9//!
10//! When someone wants to make a decision, they create a proposal. Other peers vote yes or no,
11//! and each vote includes cryptographic signatures and links to previous votes (creating a hashgraph).
12//! Once enough votes are collected, the proposal reaches consensus and everyone knows the result.
13//!
14//! The main entry point is [`service::ConsensusService`], which handles creating proposals,
15//! processing votes, and managing timeouts. You can use the default in-memory storage or plug in
16//! your own storage backend.
17
18pub mod protos {
19    pub mod consensus {
20        pub mod v1 {
21            include!(concat!(env!("OUT_DIR"), "/consensus.v1.rs"));
22        }
23    }
24}
25
26pub mod error;
27pub mod events;
28pub mod scope;
29pub mod scope_config;
30pub mod service;
31pub mod service_consensus;
32pub mod service_stats;
33pub mod session;
34pub mod storage;
35pub mod types;
36pub mod utils;