Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix rustdoc & update node-template
  • Loading branch information
Szegoo committed Nov 7, 2022
commit 41c00dba26c208fe641d2239cf98d38b96cadcfb
30 changes: 27 additions & 3 deletions bin/node-template/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use crate::{
cli::{Cli, Subcommand},
service,
};
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE};
use frame_benchmarking_cli::{
BenchmarkCmd, ExtrinsicFactory, MachineCmd, SUBSTRATE_REFERENCE_HARDWARE,
};
use node_template_runtime::{Block, EXISTENTIAL_DEPOSIT};
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
use sc_service::PartialComponents;
Expand Down Expand Up @@ -53,6 +55,22 @@ impl SubstrateCli for Cli {
pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();

if cli.run.validator {
let cmd = MachineCmd {
shared_params: cli.run.shared_params.clone(),
allow_fail: true,
tolerance: 10.0,
verify_duration: 5.0,
disk_duration: 5.0,
hash_duration: 5.0,
memory_duration: 5.0,
};

let runner = cli.create_runner(&cmd)?;

let _ = runner.sync_run(|config| cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()));
}

match &cli.subcommand {
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Some(Subcommand::BuildSpec(cmd)) => {
Expand Down Expand Up @@ -167,8 +185,14 @@ pub fn run() -> sc_cli::Result<()> {

cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory)
},
BenchmarkCmd::Machine(cmd) =>
cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
BenchmarkCmd::Machine(cmd) => {
// the hardware benchmark is run automatically if the
// validator flag is being used.
if !cli.run.validator {
return cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())
}
Ok(())
},
}
})
},
Expand Down
2 changes: 1 addition & 1 deletion client/sysinfo/src/sysinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Metric {
}
}

/// The name of the metric. It is always prefixed by the [`self::category()`].
/// The name of the metric. It is always prefixed by the [`self.category()`].
pub fn name(&self) -> &'static str {
match self {
Self::Sr25519Verify => "SR25519-Verify",
Expand Down