-1

enter image description here

How can i generate this information while starting my chain???

2
  • What command are you using to start your chain?
    – Alex Bean
    Commented Oct 6, 2022 at 8:11
  • ./target/release/substrate --dev Commented Oct 6, 2022 at 11:29

2 Answers 2

2

I'm not sure if sc_cli provides these. AFAIK it didn't.


But here is a general solution.

Check this https://github.com/darwinia-network/darwinia/blob/12f3123d8c4d6fb8896d3f42dadb7b99a168fde1/cli/src/command.rs#L117-L122.

You could put any log in your startup function.

Example:

https://github.com/zsiciarz/rust-cpuid

match cpuid::identify() {
    Ok(info) => {
        log::info!("Found: {} CPU, model: {}", info.vendor, info.codename);
        log::info!("The full brand string is: {}", info.brand);
        log::info!("Hardware AES support: {}", if info.has_feature(cpuid::CpuFeature::AES) { "yes" } else { "no" });
    },
    Err(err) => log::info!("cpuid error: {}", err),
};
match cpuid::clock_frequency() {
    Some(frequency) => log::info!("CPU speed: {} MHz", frequency),
    None => log::info!("Couldn't get CPU speed."),
};

Now, I think the question duplicates with Node startup message missing after upgrade to Polkadot v0.9.23.

0

To make the "startup messages" show again, I had to fix the dependency of

tracing-core

cargo update -p tracing-core --precise 0.1.28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.