hotmint 0.8.2

A BFT consensus framework combining Tendermint's ergonomics with HotStuff-2's protocol efficiency
Documentation

hotmint

crates.io docs.rs

A Rust BFT consensus framework combining Tendermint's engineering ergonomics with HotStuff-2's protocol efficiency.

This is the top-level facade crate that re-exports the entire Hotmint ecosystem. Add this single dependency to access all sub-crates.

Sub-Crates

Re-export Crate Description
hotmint::types hotmint-types Core data types
hotmint::crypto hotmint-crypto Ed25519 + Blake3
hotmint::consensus hotmint-consensus Consensus engine
hotmint::storage hotmint-storage Persistent storage (vsdb)
hotmint::network hotmint-network P2P networking (litep2p)
hotmint::mempool hotmint-mempool Transaction mempool
hotmint::abci hotmint-abci IPC proxy (Unix socket)
hotmint::api hotmint-api JSON-RPC API

Prelude

use hotmint::prelude::*;
// Imports: Block, BlockHash, Height, ViewNumber, Vote, VoteType,
//          QuorumCertificate, DoubleCertificate, TimeoutCertificate,
//          ValidatorId, ValidatorInfo, ValidatorSet,
//          Signer, Verifier, Signature, Epoch, EpochNumber,
//          ConsensusMessage

Quick Start

[dependencies]
hotmint = { git = "https://github.com/rust-util-collections/hotmint" }
tokio = { version = "1", features = ["full"] }
ruc = "9.3"
use ruc::*;
use hotmint::prelude::*;
use hotmint::consensus::application::Application;
use hotmint::consensus::engine::ConsensusEngineBuilder;
use hotmint::consensus::state::ConsensusState;
use hotmint::consensus::store::MemoryBlockStore;
use hotmint::crypto::Ed25519Signer;

struct MyApp;

impl Application for MyApp {
    fn on_commit(&self, block: &Block, _ctx: &BlockContext) -> Result<()> {
        println!("committed height {}", block.height.as_u64());
        Ok(())
    }
}

// 1. Generate signers and build validator set
let signers: Vec<Ed25519Signer> = (0..4)
    .map(|i| Ed25519Signer::generate(ValidatorId(i)))
    .collect();

let vs = ValidatorSet::new(
    signers.iter().enumerate().map(|(i, s)| ValidatorInfo {
        id: ValidatorId(i as u64),
        public_key: Signer::public_key(s),
        power: 1,
    }).collect()
);

// 2. Create network service and spawn engine
// (see docs/getting-started.md for the full wiring example)

Demo Binary

# run the built-in 4-node cluster demo
cargo run -p hotmint-demo

Documentation

See the docs/ directory for comprehensive guides:

License

GPL-3.0-only