CLI: Export error message and less verbose peer counter. (#5870)

* Removed numbed of active connections from informant

* Print error message when fatdb is required

* Remove peers from UI
This commit is contained in:
Arkadiy Paronyan 2017-06-27 22:40:46 +02:00 committed by GitHub
parent 59488769cf
commit 4a7bcfe4f0
3 changed files with 11 additions and 6 deletions

View File

@ -49,7 +49,7 @@ class Status extends Component {
{ netChain }
</div>
<div className={ styles.peers }>
{ netPeers.active.toFormat() }/{ netPeers.connected.toFormat() }/{ netPeers.max.toFormat() } peers
{ netPeers.connected.toFormat() }/{ netPeers.max.toFormat() } peers
</div>
</div>
</div>

View File

@ -315,7 +315,8 @@ fn start_client(
fat_db: Switch,
compaction: DatabaseCompactionProfile,
wal: bool,
cache_config: CacheConfig
cache_config: CacheConfig,
require_fat_db: bool,
) -> Result<ClientService, String> {
// load spec file
@ -343,6 +344,9 @@ fn start_client(
// check if fatdb is on
let fat_db = fatdb_switch_to_bool(fat_db, &user_defaults, algorithm)?;
if !fat_db && require_fat_db {
return Err("This command requires Parity to be synced with --fat-db on.".to_owned());
}
// prepare client and snapshot paths.
let client_path = db_dirs.client_path(algorithm);
@ -395,7 +399,8 @@ fn execute_export(cmd: ExportBlockchain) -> Result<(), String> {
cmd.fat_db,
cmd.compaction,
cmd.wal,
cmd.cache_config
cmd.cache_config,
false,
)?;
let format = cmd.format.unwrap_or_default();
@ -435,7 +440,8 @@ fn execute_export_state(cmd: ExportState) -> Result<(), String> {
cmd.fat_db,
cmd.compaction,
cmd.wal,
cmd.cache_config
cmd.cache_config,
true
)?;
let client = service.client();

View File

@ -158,7 +158,7 @@ impl Informant {
false => String::new(),
},
match (&sync_status, &network_config) {
(&Some(ref sync_info), &Some(ref net_config)) => format!("{}{}/{}/{} peers",
(&Some(ref sync_info), &Some(ref net_config)) => format!("{}{}/{} peers",
match importing {
true => format!("{} ", paint(Green.bold(), format!("{:>8}", format!("#{}", sync_info.last_imported_block_number.unwrap_or(chain_info.best_block_number))))),
false => match sync_info.last_imported_old_block_number {
@ -166,7 +166,6 @@ impl Informant {
None => String::new(),
}
},
paint(Cyan.bold(), format!("{:2}", sync_info.num_active_peers)),
paint(Cyan.bold(), format!("{:2}", sync_info.num_peers)),
paint(Cyan.bold(), format!("{:2}", sync_info.current_max_peers(net_config.min_peers, net_config.max_peers))),
),