Fatdb integration with CLI (#1464)

* fatdb integration

* --fat-db

* rerun with --pruning=archive comment
This commit is contained in:
Marek Kotewicz
2016-07-01 20:29:56 +02:00
committed by Gav Wood
parent 0a513ad06e
commit d8a4cca817
11 changed files with 91 additions and 56 deletions

View File

@@ -203,6 +203,7 @@ Database Options:
--db-compaction TYPE Database compaction type. TYPE may be one of:
ssd - suitable for SSDs and fast HDDs;
hdd - suitable for slow HDDs [default: ssd].
--fat-db Fat database.
Import/Export Options:
--from BLOCK Export from block BLOCK, which may be an index or
@@ -362,6 +363,7 @@ pub struct Args {
pub flag_ipcapi: Option<String>,
pub flag_db_cache_size: Option<usize>,
pub flag_db_compaction: String,
pub flag_fat_db: bool,
}
pub fn print_version() {

View File

@@ -333,6 +333,14 @@ impl Configuration {
_ => { die!("Invalid pruning method given."); }
};
if self.args.flag_fat_db {
if let journaldb::Algorithm::Archive = client_config.pruning {
client_config.trie_spec = TrieSpec::Fat;
} else {
die!("Fatdb is not supported. Please rerun with --pruning=archive")
}
}
// forced state db cache size if provided
client_config.db_cache_size = self.args.flag_db_cache_size.and_then(|cs| Some(cs / 4));