ops

Both cuprate_blockchain and cuprate_txpool expose an ops module containing abstracted abstracted Monero-related database operations.

For example, cuprate_blockchain::ops::block::add_block.

These functions build on-top of the database traits and allow for more abstracted database operations.

For example, instead of these signatures:

#![allow(unused)]
fn main() {
fn get(_: &Key) -> Value;
fn put(_: &Key, &Value);
}

the ops module provides much higher-level signatures like such:

#![allow(unused)]
fn main() {
fn add_block(block: &Block) -> Result<_, _>;
}

Although these functions are exposed, they are not the main API, that would be next section: the tower::Service (which uses these functions).

Last change: 2024-10-17, commit: 978d72b