mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 01:07:57 +00:00
New database trait (#5549)
* Introduce trait * The trait * Generic * Basic impls. * Remove unneeded bounds * Minor changes * Switch over to the new DB trait * Integrated parity-db and added CLI for db selection * Default impl. * Fix logs. * Started integrating subdb * Apply suggestions from code review Co-Authored-By: Cecile Tonglet <cecile@parity.io> * Apply suggestions from code review Co-Authored-By: Nikolay Volf <nikvolf@gmail.com> * Enable subdb * Bump parity-db * Fixed CLI macro * Fixed browser build * Fixed features * Sort out features * Use parity-db from crates.io * Typo Co-authored-by: arkpar <arkady.paronyan@gmail.com> Co-authored-by: Cecile Tonglet <cecile@parity.io> Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
use crate::arg_enums::{
|
||||
ExecutionStrategy, TracingReceiver, WasmExecutionMethod, DEFAULT_EXECUTION_BLOCK_CONSTRUCTION,
|
||||
DEFAULT_EXECUTION_IMPORT_BLOCK, DEFAULT_EXECUTION_OFFCHAIN_WORKER, DEFAULT_EXECUTION_OTHER,
|
||||
DEFAULT_EXECUTION_SYNCING,
|
||||
DEFAULT_EXECUTION_SYNCING, Database,
|
||||
};
|
||||
use crate::params::PruningParams;
|
||||
use crate::Result;
|
||||
@@ -54,6 +54,16 @@ pub struct ImportParams {
|
||||
#[structopt(flatten)]
|
||||
pub execution_strategies: ExecutionStrategiesParams,
|
||||
|
||||
/// Select database backend to use.
|
||||
#[structopt(
|
||||
long = "database",
|
||||
alias = "db",
|
||||
value_name = "DB",
|
||||
case_insensitive = true,
|
||||
default_value = "RocksDb"
|
||||
)]
|
||||
pub database: Database,
|
||||
|
||||
/// Limit the memory the database cache can use.
|
||||
#[structopt(long = "db-cache", value_name = "MiB")]
|
||||
pub database_cache_size: Option<usize>,
|
||||
@@ -132,6 +142,11 @@ impl ImportParams {
|
||||
pub fn database_cache_size(&self) -> Option<usize> {
|
||||
self.database_cache_size
|
||||
}
|
||||
|
||||
/// Limit the memory the database cache can use.
|
||||
pub fn database(&self) -> Database {
|
||||
self.database
|
||||
}
|
||||
}
|
||||
|
||||
/// Execution strategies parameters.
|
||||
|
||||
Reference in New Issue
Block a user