mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 12:48:00 +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:
@@ -15,7 +15,7 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::error;
|
||||
use crate::params::{BlockNumber, PruningParams, SharedParams};
|
||||
use crate::params::{BlockNumber, DatabaseParams, PruningParams, SharedParams};
|
||||
use crate::CliConfiguration;
|
||||
use log::info;
|
||||
use sc_service::{
|
||||
@@ -48,7 +48,7 @@ pub struct ExportBlocksCmd {
|
||||
pub to: Option<BlockNumber>,
|
||||
|
||||
/// Use binary output rather than JSON.
|
||||
#[structopt(long = "binary", value_name = "BOOL", parse(try_from_str), default_value("false"))]
|
||||
#[structopt(long)]
|
||||
pub binary: bool,
|
||||
|
||||
#[allow(missing_docs)]
|
||||
@@ -58,6 +58,10 @@ pub struct ExportBlocksCmd {
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
pub pruning_params: PruningParams,
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
pub database_params: DatabaseParams,
|
||||
}
|
||||
|
||||
impl ExportBlocksCmd {
|
||||
@@ -103,4 +107,8 @@ impl CliConfiguration for ExportBlocksCmd {
|
||||
fn pruning_params(&self) -> Option<&PruningParams> {
|
||||
Some(&self.pruning_params)
|
||||
}
|
||||
|
||||
fn database_params(&self) -> Option<&DatabaseParams> {
|
||||
Some(&self.database_params)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user