Information about used paths added to general output block (#5904)

* Information about used paths added to general output block

* Print was added into execute light also
This commit is contained in:
Anton Gavrilov 2017-06-22 21:08:56 +03:00 committed by Gav Wood
parent 53609f703e
commit f9033facd3

View File

@ -43,7 +43,7 @@ use params::{
}; };
use helpers::{to_client_config, execute_upgrades, passwords_from_files}; use helpers::{to_client_config, execute_upgrades, passwords_from_files};
use upgrade::upgrade_key_location; use upgrade::upgrade_key_location;
use dir::Directories; use dir::{Directories, DatabaseDirectories};
use cache::CacheConfig; use cache::CacheConfig;
use user_defaults::UserDefaults; use user_defaults::UserDefaults;
use dapps; use dapps;
@ -193,7 +193,9 @@ fn execute_light(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) ->
// create dirs used by parity // create dirs used by parity
cmd.dirs.create_dirs(cmd.dapps_conf.enabled, cmd.ui_conf.enabled, cmd.secretstore_conf.enabled)?; cmd.dirs.create_dirs(cmd.dapps_conf.enabled, cmd.ui_conf.enabled, cmd.secretstore_conf.enabled)?;
info!("Starting {}", Colour::White.bold().paint(version())); //print out running parity environment
print_running_environment(&spec.name, &cmd.dirs, &db_dirs, &cmd.dapps_conf);
info!("Running in experimental {} mode.", Colour::Blue.bold().paint("Light Client")); info!("Running in experimental {} mode.", Colour::Blue.bold().paint("Light Client"));
// TODO: configurable cache size. // TODO: configurable cache size.
@ -396,8 +398,10 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> R
daemonize(pid_file)?; daemonize(pid_file)?;
} }
//print out running parity environment
print_running_environment(&spec.name, &cmd.dirs, &db_dirs, &cmd.dapps_conf);
// display info about used pruning algorithm // display info about used pruning algorithm
info!("Starting {}", Colour::White.bold().paint(version()));
info!("State DB configuration: {}{}{}", info!("State DB configuration: {}{}{}",
Colour::White.bold().paint(algorithm.as_str()), Colour::White.bold().paint(algorithm.as_str()),
match fat_db { match fat_db {
@ -758,6 +762,13 @@ fn daemonize(_pid_file: String) -> Result<(), String> {
Err("daemon is no supported on windows".into()) Err("daemon is no supported on windows".into())
} }
fn print_running_environment(spec_name: &String, dirs: &Directories, db_dirs: &DatabaseDirectories, dapps_conf: &dapps::Configuration) {
info!("Starting {}", Colour::White.bold().paint(version()));
info!("Keys path {}", Colour::White.bold().paint(dirs.keys_path(spec_name).to_string_lossy().into_owned()));
info!("DB path {}", Colour::White.bold().paint(db_dirs.db_root_path().to_string_lossy().into_owned()));
info!("Path to dapps {}", Colour::White.bold().paint(dapps_conf.dapps_path.to_string_lossy().into_owned()));
}
fn prepare_account_provider(spec: &SpecType, dirs: &Directories, data_dir: &str, cfg: AccountsConfig, passwords: &[String]) -> Result<AccountProvider, String> { fn prepare_account_provider(spec: &SpecType, dirs: &Directories, data_dir: &str, cfg: AccountsConfig, passwords: &[String]) -> Result<AccountProvider, String> {
use ethcore::ethstore::EthStore; use ethcore::ethstore::EthStore;
use ethcore::ethstore::dir::RootDiskDirectory; use ethcore::ethstore::dir::RootDiskDirectory;