Expand description
Cuprate Consensus
This crate contains 3 tower::Service
s that implement Monero’s consensus rules:
BlockChainContextService
Which handles keeping the current state of the blockchain.BlockVerifierService
Which handles block verification.TxVerifierService
Which handles transaction verification.
This crate is generic over the database which is implemented as a tower::Service
. To
implement a database you need to have a service which accepts BlockchainReadRequest
and responds
with BlockchainResponse
.
Re-exports§
pub use block::BlockVerifierService;
pub use block::VerifyBlockRequest;
pub use block::VerifyBlockResponse;
pub use transactions::TxVerifierService;
pub use transactions::VerifyTxRequest;
pub use transactions::VerifyTxResponse;
Modules§
- __
private - block
- Block Verifier Service.
- transactions
- Transaction Verifier Service.
Structs§
- Block
Chain Context - Blockchain context which keeps a token of validity so users will know when the data is no longer valid.
- Block
Chain Context Service - The blockchain context service.
- Context
Config - Config for the context service.
Enums§
- Block
Chain Context Request - A request to the blockchain context cache.
- Block
Chain Context Response - Blockchain
Read Request - A read request to the blockchain database.
- Blockchain
Response - A response from the database.
- Extended
Consensus Error - An Error returned from one of the consensus services.
- Hard
Fork - An identifier for every hard-fork Monero has had.
Functions§
- generate_
genesis_ block - Generates the Monero genesis block.
- initialize_
blockchain_ context - Initialize the blockchain context service.
- initialize_
verifier - Initialize the 2 verifier
tower::Service
s (block and transaction).