Crate cuprate_consensus

Source
Expand description

Cuprate Consensus

This crate contains 3 tower::Services that implement Monero’s consensus rules:

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§

BlockChainContext
Blockchain context which keeps a token of validity so users will know when the data is no longer valid.
BlockChainContextService
The blockchain context service.
ContextConfig
Config for the context service.

Enums§

BlockChainContextRequest
A request to the blockchain context cache.
BlockChainContextResponse
BlockchainReadRequest
A read request to the blockchain database.
BlockchainResponse
A response from the database.
ExtendedConsensusError
An Error returned from one of the consensus services.
HardFork
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::Services (block and transaction).