ethcore client config

This commit is contained in:
Nikolay Volf
2016-06-27 13:58:12 +02:00
parent 627b67db0a
commit 2e5d5f12dd
6 changed files with 44 additions and 6 deletions

View File

@@ -170,7 +170,13 @@ Footprint Options:
--cache MEGABYTES Set total amount of discretionary memory to use for
the entire system, overrides other cache and queue
options.
--db-cache-size MB Database cache size.
Database Options:
--db-cache-size MB Database cache size. Default if not specified.
--db-compaction TYPE Database compaction type. TYPE may be one of default, hdd
default - suitable for ssd backing storage/fast hdd
hdd - sutable for slow storage
[default: default].
Import/Export Options:
--from BLOCK Export from block BLOCK, which may be an index or
@@ -323,6 +329,7 @@ pub struct Args {
pub flag_ipcpath: Option<String>,
pub flag_ipcapi: Option<String>,
pub flag_db_cache_size: Option<usize>,
pub flag_db_compaction: String,
}
pub fn print_version() {

View File

@@ -278,6 +278,13 @@ impl Configuration {
// forced state db cache size if provided
client_config.db_cache_size = self.args.flag_db_cache_size.and_then(|cs| Some(cs / 4));
// compaction profile
client_config.db_compaction_profile = match self.args.flag_db_compaction.as_str() {
"default" => DatabaseCompactionProfile::Default,
"hdd" => DatabaseCompactionProfile::HDD,
_ => { die!("Invalid compaction profile given (--db-compaction argument), expected hdd/default."); }
};
if self.args.flag_jitvm {
client_config.vm_type = VMType::jit().unwrap_or_else(|| die!("Parity built without jit vm."))
}