Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

Commit 373ef3b

Browse files
author
Guantong
committed
1 parent 8a59e12 commit 373ef3b

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

node/src/command.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,11 @@ pub fn run() -> Result<()> {
654654

655655
runner.run_node_until_exit(|config| async move {
656656
let chain_spec = &config.chain_spec;
657-
let hwbench = if !cli.no_hardware_benchmarks {
657+
let hwbench = (!cli.no_hardware_benchmarks).then_some(
658658
config.database.path().map(|database_path| {
659659
let _ = std::fs::create_dir_all(database_path);
660660
sc_sysinfo::gather_hwbench(Some(database_path))
661-
})
662-
} else {
663-
None
664-
};
661+
})).flatten();
665662

666663
set_default_ss58_version(chain_spec);
667664

node/src/service/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,14 @@ where
416416

417417
if let Some(hwbench) = hwbench {
418418
sc_sysinfo::print_hwbench(&hwbench);
419+
// Here you can check whether the hardware meets your chains' requirements. Putting a link
420+
// in there and swapping out the requirements for your own are probably a good idea. The
421+
// requirements for a para-chain are dictated by its relay-chain.
422+
if !SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench) && validator {
423+
log::warn!(
424+
"⚠️ The hardware does not meet the minimal requirements for role 'Authority'."
425+
);
426+
}
419427

420428
if let Some(ref mut telemetry) = telemetry {
421429
let telemetry_handle = telemetry.handle();

0 commit comments

Comments
 (0)