Skip to content

Commit

Permalink
Fixed pruning docs (paritytech#11519)
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo authored May 28, 2022
1 parent fe5bf49 commit 9251791
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions client/cli/src/params/pruning_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ use sc_service::{KeepBlocks, PruningMode};
pub struct PruningParams {
/// Specify the state pruning mode, a number of blocks to keep or 'archive'.
///
/// Default is to keep all block states if the node is running as a
/// validator (i.e. 'archive'), otherwise state is only kept for the last
/// 256 blocks.
/// Default is to keep only the last 256 blocks,
/// otherwise, the state can be kept for all of the blocks (i.e 'archive'),
/// or for all of the canonical blocks (i.e 'archive-canonical').
#[clap(long, value_name = "PRUNING_MODE")]
pub pruning: Option<String>,
/// Specify the number of finalized blocks to keep in the database.
Expand Down
3 changes: 2 additions & 1 deletion client/state-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,15 @@ impl PruningMode {
}
}

/// Is this an archive (either ArchiveAll or ArchiveCanonical) pruning mode?
/// Returns the pruning mode
pub fn id(&self) -> &[u8] {
match self {
PruningMode::ArchiveAll => PRUNING_MODE_ARCHIVE,
PruningMode::ArchiveCanonical => PRUNING_MODE_ARCHIVE_CANON,
PruningMode::Constrained(_) => PRUNING_MODE_CONSTRAINED,
}
}

pub fn from_id(id: &[u8]) -> Option<Self> {
match id {
PRUNING_MODE_ARCHIVE => Some(Self::ArchiveAll),
Expand Down

0 comments on commit 9251791

Please sign in to comment.