mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
State pruning (#216)
* Started work on state db * Updated for a new hash type * Pruning and tests * Generalize on the block hash/key type * Integrate with the client backend * Merge w master * CLI options * Updated for light client refactoring * Used IntoIterator * Fixed invalid input hadling
This commit is contained in:
committed by
Gav Wood
parent
de8dedd878
commit
a53b47e11a
@@ -20,6 +20,7 @@ use transaction_pool;
|
||||
use runtime_primitives::MakeStorage;
|
||||
pub use network::Role;
|
||||
pub use network::NetworkConfiguration;
|
||||
pub use client_db::PruningMode;
|
||||
|
||||
/// Service configuration.
|
||||
pub struct Configuration {
|
||||
@@ -33,6 +34,8 @@ pub struct Configuration {
|
||||
pub keystore_path: String,
|
||||
/// Path to the database.
|
||||
pub database_path: String,
|
||||
/// Pruning settings.
|
||||
pub pruning: PruningMode,
|
||||
/// Additional key seeds.
|
||||
pub keys: Vec<String>,
|
||||
/// The name of the chain.
|
||||
@@ -58,6 +61,7 @@ impl Default for Configuration {
|
||||
genesis_storage: Box::new(Default::default),
|
||||
telemetry: Default::default(),
|
||||
name: "Anonymous".into(),
|
||||
pruning: PruningMode::ArchiveAll,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ use exit_future::Signal;
|
||||
|
||||
pub use self::error::{ErrorKind, Error};
|
||||
pub use self::components::{Components, FullComponents, LightComponents};
|
||||
pub use config::{Configuration, Role};
|
||||
pub use config::{Configuration, Role, PruningMode};
|
||||
|
||||
/// Polkadot service.
|
||||
pub struct Service<Components: components::Components> {
|
||||
@@ -118,6 +118,7 @@ impl<Components> Service<Components>
|
||||
let db_settings = client_db::DatabaseSettings {
|
||||
cache_size: None,
|
||||
path: config.database_path.into(),
|
||||
pruning: config.pruning,
|
||||
};
|
||||
|
||||
let (client, on_demand) = components.build_client(db_settings, executor, config.genesis_storage)?;
|
||||
|
||||
Reference in New Issue
Block a user