Crate cuprate_pruning

Source
Expand description

§Pruning Mechanism for Monero

This crate provides an implementation of the pruning mechanism used in Monero. The main data structure, PruningSeed, encapsulates the logic for creating and manipulating pruning seeds, which determine the set of blocks to be pruned from the blockchain.

PruningSeed also contains a method for checking if a pruning seed is valid for Monero rules (must only be split into 8 parts):

use cuprate_pruning::PruningSeed;

let seed: u32 = 386; // the seed you want to check is valid
match PruningSeed::decompress_p2p_rules(seed) {
    Ok(seed) => seed, // seed is valid
    Err(e) => panic!("seed is invalid")
};

Structs§

DecompressedPruningSeed
This represents a valid Monero pruning seed.

Enums§

PruningError
PruningSeed
A valid pruning seed for a Monero node.

Constants§

CRYPTONOTE_PRUNING_LOG_STRIPES
The default log stripes for Monero pruning.
CRYPTONOTE_PRUNING_STRIPE_SIZE
The amount of blocks that peers keep before another stripe starts storing blocks.
CRYPTONOTE_PRUNING_TIP_BLOCKS
The amount of blocks from the top of the chain that should not be pruned.