mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
Fix purge-chain and print DB info on startup (#5840)
* purge-chain accepts --db option * print DB info on startup * Small refactoring * Added back &self * Add DatabaseParams for PurgeChain, ImportParams and ExportBlocks * Don't force default value * Remove unused fields * Update client/cli/src/commands/export_blocks_cmd.rs * Fix stuff Co-authored-by: Cecile Tonglet <cecile@parity.io> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -14,10 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use sc_service::config::DatabaseConfig;
|
||||
use std::path::PathBuf;
|
||||
use structopt::StructOpt;
|
||||
use crate::arg_enums::Database;
|
||||
|
||||
/// Shared parameters used by all `CoreParams`.
|
||||
#[derive(Debug, StructOpt, Clone)]
|
||||
@@ -72,27 +70,6 @@ impl SharedParams {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the database configuration object for the parameters provided
|
||||
pub fn database_config(
|
||||
&self,
|
||||
base_path: &PathBuf,
|
||||
cache_size: usize,
|
||||
database: Database,
|
||||
) -> DatabaseConfig {
|
||||
match database {
|
||||
Database::RocksDb => DatabaseConfig::RocksDb {
|
||||
path: base_path.join("db"),
|
||||
cache_size,
|
||||
},
|
||||
Database::SubDb => DatabaseConfig::SubDb {
|
||||
path: base_path.join("subdb"),
|
||||
},
|
||||
Database::ParityDb => DatabaseConfig::ParityDb {
|
||||
path: base_path.join("paritydb"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the filters for the logging
|
||||
pub fn log_filters(&self) -> Option<String> {
|
||||
self.log.clone()
|
||||
|
||||
Reference in New Issue
Block a user