Fatdb integration with CLI (#1464)
* fatdb integration * --fat-db * rerun with --pruning=archive comment
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user