2

I'm trying to benchmark the pallet_template from the substrate-node-template example but am getting the error: Found argument 'Cargo.toml' which wasn't expected, or isn't valid in this context.

I have already built the runtime with the runtime-benchmarks flag enabled, and have also included the list_benchmark!(list, extra, pallet_template, TemplateModule) and add_benchmark!(params, batches, pallet_template, TemplateModule) in the runtime/lib.rs. But when I run the command -

./target/release/node-template benchmark pallet \
    --chain dev \
    --execution=wasm \
    --wasm-execution=compiled \
    --pallet pallet_template \
    --extrinsic * \
    --steps 50 \
    --repeat 20 \
    --output pallets/template/src/weight.rs

I keep getting this weird error: Found argument 'Cargo.toml' which wasn't expected, or isn't valid in this context. I have used the exact same command mentioned on the official substrate benchmarking tutorial and don't understand why the compiler is telling me that I'm passing Cargo.toml as an argument. I'm still a beginner in Substrate so please forgive me if I'm asking a very dumb question 🙏.

Please help me understand where I'm missing it.

1 Answer 1

1

Depending on your shell you have to escape the * symbol or put it into quotes.
Please try again with --extrinsic "", --extrinsic "\*" or --extrinsic "*" which should all be equialent.

2
  • 1
    Thanks a lot! It worked after putting * in quotes.
    – AKASH S M
    Sep 22, 2022 at 11:34
  • Please consider marking your question as "answered" so that other people can easily find it. Sep 22, 2022 at 11:59

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.

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