0

I was trying to have a close look at how chain_spec.rs was constructed, and wanted to output to the console for debugging purposes, but was having some trouble executing print and log::info. So, I would like to know if there are any workarounds?

For example, in order to test the output of from_string_with_seed, I tried displaying the type returned, but realized the type didn't have the appropriate implementations of the required traits in order for the print() or info!() to work without manually adding them.

Adding info

What I originally wanted to understand was how the default seed string //Alice generated the root key. The reason for my question was because my understanding is that seeds or mnemonic are generated from private keys, not vice versa. I do understand seeds can be used to recover keys, but that didn't seem like what from_string_with_seed was doing for a few reasons.

Therefore, I decided to play around with the parameter for the function to see what it would return in different scenarios, but ran into a wall actually printing it to the console.

4
  • Can you be more clear on what you want to debug? I mean when Debug ins't implemented, you need to derive the trait.
    – bkchr
    Oct 10, 2022 at 18:06
  • what kind of value do you hope to see with print?
    – Shawn Tabrizi
    Oct 10, 2022 at 18:07
  • Apol for the ambiguity, new to a lot of things, not just substrate - will ask better questions moving forward. Updated above with context.
    – kenta_desu
    Oct 11, 2022 at 14:00
  • substrate.stackexchange.com/a/5294/73 here I have explained how the private key is generated. Or better, how the uri is build.
    – bkchr
    Oct 11, 2022 at 18:24

0

Your Answer

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

Browse other questions tagged or ask your own question.