From 0b9a0b138b0affa27a965561641e4e3e2621c5f1 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Wed, 4 Jan 2017 15:07:49 +0100 Subject: [PATCH] remove --light CLI --- parity/cli/mod.rs | 4 --- parity/cli/usage.txt | 2 -- parity/configuration.rs | 2 -- parity/run.rs | 63 ----------------------------------------- 4 files changed, 71 deletions(-) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index 36bc1412b..47a0af0bb 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -94,7 +94,6 @@ usage! { flag_db_path: String = "$BASE/chains", or |c: &Config| otry!(c.parity).db_path.clone(), flag_keys_path: String = "$BASE/keys", or |c: &Config| otry!(c.parity).keys_path.clone(), flag_identity: String = "", or |c: &Config| otry!(c.parity).identity.clone(), - flag_light: bool = false, or |c: &Config| otry!(c.parity).light.clone(), // -- Account Options flag_unlock: Option = None, @@ -322,7 +321,6 @@ struct Operating { db_path: Option, keys_path: Option, identity: Option, - light: Option, } #[derive(Default, Debug, PartialEq, RustcDecodable)] @@ -551,7 +549,6 @@ mod tests { flag_db_path: "$HOME/.parity/chains".into(), flag_keys_path: "$HOME/.parity/keys".into(), flag_identity: "".into(), - flag_light: false, // -- Account Options flag_unlock: Some("0xdeadbeefcafe0000000000000000000000000000".into()), @@ -730,7 +727,6 @@ mod tests { db_path: None, keys_path: None, identity: None, - light: None, }), account: Some(Account { unlock: Some(vec!["0x1".into(), "0x2".into(), "0x3".into()]), diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index 884dc4d12..7c3e5cc7d 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -66,8 +66,6 @@ Operating Options: --keys-path PATH Specify the path for JSON key files to be found (default: {flag_keys_path}). --identity NAME Specify your node's name. (default: {flag_identity}) - --light Run in light client mode. Very experimental. - (default: {flag_light}) Account Options: --unlock ACCOUNTS Unlock ACCOUNTS for the duration of the execution. diff --git a/parity/configuration.rs b/parity/configuration.rs index 6968a71ec..85ff61d5c 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -341,7 +341,6 @@ impl Configuration { no_periodic_snapshot: self.args.flag_no_periodic_snapshot, check_seal: !self.args.flag_no_seal_check, download_old_blocks: !self.args.flag_no_ancient_blocks, - light: self.args.flag_light, verifier_settings: verifier_settings, }; Cmd::Run(run_cmd) @@ -1033,7 +1032,6 @@ mod tests { check_seal: true, download_old_blocks: true, verifier_settings: Default::default(), - light: false, })); } diff --git a/parity/run.rs b/parity/run.rs index 5c28d5ad9..8ac0669d8 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -96,7 +96,6 @@ pub struct RunCmd { pub check_seal: bool, pub download_old_blocks: bool, pub verifier_settings: VerifierSettings, - pub light: bool, } pub fn open_ui(dapps_conf: &dapps::Configuration, signer_conf: &signer::Configuration) -> Result<(), String> { @@ -116,64 +115,6 @@ pub fn open_ui(dapps_conf: &dapps::Configuration, signer_conf: &signer::Configur Ok(()) } -// Execute in light client mode. -pub fn execute_light(cmd: RunCmd) -> Result { - use light::client::{Config as ClientConfig, Service as LightClientService}; - use ethsync::{LightSync, LightSyncParams, ManageNetwork}; - - let panic_handler = PanicHandler::new_in_arc(); - - info!( - "Configured in {} mode. Note that this feature is {}.", - Colour::Blue.bold().paint("Light Client"), - Colour::Red.bold().paint("experimental"), - ); - - let mut client_config = ClientConfig::default(); - let queue_size = cmd.cache_config.queue(); - - client_config.queue.max_queue_size = queue_size as usize; - client_config.queue.verifier_settings = cmd.verifier_settings; - - let spec = try!(cmd.spec.spec()); - let service = try!(LightClientService::start(client_config, &spec) - .map_err(|e| format!("Error starting light client service: {}", e))); - - let net_conf = try!(cmd.net_conf.into_basic() - .map_err(|e| format!("Failed to create network config: {}", e))); - - let sync_params = LightSyncParams { - network_config: net_conf, - client: service.client().clone(), - network_id: cmd.network_id.unwrap_or(spec.network_id()), - subprotocol_name: *b"les", - }; - - let sync = try!(LightSync::new(sync_params) - .map_err(|e| format!("Failed to initialize sync service: {}", e))); - - sync.start_network(); - - let log_client = service.client().clone(); - ::std::thread::spawn(move || { - // TODO: proper informant. - loop { - ::std::thread::sleep(::std::time::Duration::from_secs(5)); - let chain_info = log_client.chain_info(); - let queue_info = log_client.queue_info(); - println!( - "#{} {:5}+{:5} Qed", - chain_info.best_block_number, - queue_info.unverified_queue_size, - queue_info.verified_queue_size - ); - } - }); - - wait_for_exit(panic_handler, None, false); - Ok(false) -} - pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc) -> Result { if cmd.ui && cmd.dapps_conf.enabled { // Check if Parity is already running @@ -183,10 +124,6 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc) -> R } } - if cmd.light { - return execute_light(cmd); - } - // set up panic handler let panic_handler = PanicHandler::new_in_arc();