Blockpilot is designed for extensibility: swap out consensus protocols, add new block building APIs, or integrate with other distributed systems with a clean, decoupled architecture.
Blockpilot is a modular framework for building distributed applications with a containerized, pluggable consensus engine. At present it leverages the Commonware library for consensus, and communicates via gRPC for clean separation between the application and consensus layers.
+--------------------+ gRPC +---------------------------+
| blockpilot- | <-----------------> | blockpilot-consensus- |
| application | | engine |
+--------------------+ +---------------------------+
| Transaction Pool | | Commonware Consensus |
| | | Engine |
| Block Construction | | (e.g. Threshold Simplex) |
| Engine | | OR |
| | | Tendermint Based |
| Execution Client | | Engine |
+--------------------+ +---------------------------+
- blockpilot-application: Accepts transactions (either via Execution Client or custom Transaction Pool), manages final block cosntruction, and submits to the consensus engine via gRPC.
- blockpilot-consensus-engine: Exposes a gRPC API, runs a consensus protocol, and manages consensus state. Multiple instances form a distributed network.
- Transaction Submission: A client submits a transaction to the application (or Execution Client).
- Block Engine: When chosen to propose a block, the application may either poll the Execution Client or construct a block from privately gossipped/locally persisted transactions. It will then forward to the consensus engine.
- Consensus Handling: The consensus engine, participates in a distributed protocol with its peers to order and finalize the transaction.
- Finalization: Once consensus is reached, the consensus engine notifies the application and the block is marked as finalized. Further interaction and a finalization protocol may continue with an Execution Client.
- Each consensus engine is configured with a list of peer addresses ("bootstrap peers") in its configuration.
- On startup, each engine connects to its peers using a P2P networking protocol.
- Once connected, the nodes exchange messages and begin participating in the consensus protocol.
- The application can check readiness by polling the consensus engine's status endpoint.
cargo build
cargo run -p consensus-engine
cargo run -p application
Commonware's consensus engines (Threshold Simplex) expects:
- Payload: A transaction or block data (as bytes)
- Context: Info about the current consensus round:
view
: Current round/epochheight
: Block or sequence numberparent
: Hash of parent block/proposal
- Namespace: Optional application ID