Skip to content

Commit

Permalink
Revert "CLI option force purge chain from filesystem (#855)"
Browse files Browse the repository at this point in the history
This reverts commit 880effb.
  • Loading branch information
simonsso committed Apr 15, 2024
1 parent beff83b commit f2413d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
4 changes: 0 additions & 4 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ pub struct Cli {
#[arg(long)]
pub no_hardware_benchmarks: bool,

/// Purge chain from storage, for that time when purge-chain subcommand cannot be used
#[arg(long)]
pub force_purge_chain_db_from_filesystem: bool,

/// Relay chain arguments
#[arg(raw = true)]
pub relaychain_args: Vec<String>,
Expand Down
18 changes: 1 addition & 17 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use sc_cli::{
};
use sc_service::config::{BasePath, PrometheusConfig};
use sp_runtime::traits::AccountIdConversion;
use std::{fs, net::SocketAddr};
use std::net::SocketAddr;
// default to Nodle parachain id
const DEFAULT_PARA_ID: u32 = 2026;

Expand Down Expand Up @@ -248,22 +248,6 @@ pub fn run() -> Result<()> {
.map(|e| e.para_id)
.ok_or("Could not find parachain ID in chain-spec.")?;

if cli.force_purge_chain_db_from_filesystem {
let db_path =
config.database.path().and_then(|p| p.parent()).ok_or_else(|| {
sc_cli::Error::Input("Cannot purge custom database implementation".into())
})?;
match fs::remove_dir_all(&db_path) {
Ok(_) => {
log::warn!("🧯 Removed {:?}", &db_path);
}
Err(ref err) if err.kind() == std::io::ErrorKind::NotFound => {
log::error!("🧯 {:?} did not exist.", &db_path);
}
Err(err) => return Result::Err(err.into()),
}
};

let polkadot_cli = RelayChainCli::new(
&config,
[RelayChainCli::executable_name()]
Expand Down

0 comments on commit f2413d7

Please sign in to comment.