1
$ cargo build --release --features runtime-benchmarks
$ ./target/release/dorafactory-node benchmark --chain dev --execution=wasm --wasm-execution=compiled --pallet pallet_template --extrinsic do_something -
-steps 20 --repeat 50 --json-file=raw.json --output ./

=====report=====

2022-03-27 03:38:52 assembling new collators for new session 0 at #0    
2022-03-27 03:38:52 assembling new collators for new session 1 at #0    
Error: Input("No benchmarks found which match your input.")
3

2 Answers 2

1

Looks like this line is missing:

list_benchmark!(list, extra, pallet_dao_core, DaoCoreModule);

(or whatever pallet your do_something extrinsic is in)

(./target/release/dorafactory-node benchmark --chain=dev --list did not seem to show the benchmark)

1
  • oh, I lost list_benhmark, thanks!
    – 99kies
    Mar 27, 2022 at 9:39
3

Using “—-dev” instead of “—-chain dev” is a better option for these kinds of tests. The reason is “—-dev” has an implicit “——tmp” which makes sure you don’t need to deal with the previous history of your development tests. It starts a fresh chain for you. In your case I’m afraid that while you’re running a new client with the benchmark features built-in, your runtime is still coming from your previous builds, meaning it doesn’t feature the benchmark option. This is because the runtime would only change on a runtime upgrade. But when you start a fresh dev blockchain the currently built runtime will be used as your runtime.

2
  • emmm, It's same. still failed.
    – 99kies
    Mar 26, 2022 at 23:29
  • Can you instead of pallet_template and doSomthing pass “*” and check if it runs?
    – Alex Sed
    Mar 27, 2022 at 1:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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