mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 21:51:06 +00:00
Fixed pruning docs (#11519)
This commit is contained in:
@@ -25,9 +25,9 @@ use sc_service::{KeepBlocks, PruningMode};
|
|||||||
pub struct PruningParams {
|
pub struct PruningParams {
|
||||||
/// Specify the state pruning mode, a number of blocks to keep or 'archive'.
|
/// 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
|
/// Default is to keep only the last 256 blocks,
|
||||||
/// validator (i.e. 'archive'), otherwise state is only kept for the last
|
/// otherwise, the state can be kept for all of the blocks (i.e 'archive'),
|
||||||
/// 256 blocks.
|
/// or for all of the canonical blocks (i.e 'archive-canonical').
|
||||||
#[clap(long, value_name = "PRUNING_MODE")]
|
#[clap(long, value_name = "PRUNING_MODE")]
|
||||||
pub pruning: Option<String>,
|
pub pruning: Option<String>,
|
||||||
/// Specify the number of finalized blocks to keep in the database.
|
/// Specify the number of finalized blocks to keep in the database.
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ impl PruningMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is this an archive (either ArchiveAll or ArchiveCanonical) pruning mode?
|
/// Returns the pruning mode
|
||||||
pub fn id(&self) -> &[u8] {
|
pub fn id(&self) -> &[u8] {
|
||||||
match self {
|
match self {
|
||||||
PruningMode::ArchiveAll => PRUNING_MODE_ARCHIVE,
|
PruningMode::ArchiveAll => PRUNING_MODE_ARCHIVE,
|
||||||
@@ -247,6 +247,7 @@ impl PruningMode {
|
|||||||
PruningMode::Constrained(_) => PRUNING_MODE_CONSTRAINED,
|
PruningMode::Constrained(_) => PRUNING_MODE_CONSTRAINED,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_id(id: &[u8]) -> Option<Self> {
|
pub fn from_id(id: &[u8]) -> Option<Self> {
|
||||||
match id {
|
match id {
|
||||||
PRUNING_MODE_ARCHIVE => Some(Self::ArchiveAll),
|
PRUNING_MODE_ARCHIVE => Some(Self::ArchiveAll),
|
||||||
|
|||||||
Reference in New Issue
Block a user