0

In substrate-node-template, is there a way that I can use to create an extrinsic in outer-node?

I want to specifically create an unsigned extrinsic for a specific pallet call and I found this struct that should do the job, but I don't know how to provide the arguments such as Call and I don't want to create an inherent, just an unsigned extrinsic for a specific pallet call.

Previously I was using subxt but I want to do it manually since I am in the node directly.

1 Answer 1

1

Your are right to think that you need to encode the UncheckedExtrinsic type.

For that you need:

  1. signature, which in your case it should be None.
  2. A call, which should be the encoding of enum RuntimeCall in your runtime.

The easy way to find the enum RuntimeCall is to get it from your runtime crate. This enum is generated by construct_runtime. For example, in the polkadot runtime, you can see it here.

4
  • thanks but i could not find it! is there a specific way to retreive that enum? currently i created a runtime api that returns the unckedextrinsic unsigned extrinsic that i want
    – dadzerlaze
    Commented Feb 8, 2023 at 7:41
  • Did you see the link I posted? paritytech.github.io/substrate/master/kitchensink_runtime/… Any file has construct_runtime has enum RuntimeCall.
    – kianenigma
    Commented Feb 15, 2023 at 12:03
  • yes i saw the link you posted and i wanted to know how to retreive that enum in my own substrate node, i tried to run cargo docs to open all the generated enums and i didn't find it
    – dadzerlaze
    Commented Feb 16, 2023 at 6:37
  • and i think a runtime api is better to be honest
    – dadzerlaze
    Commented Feb 16, 2023 at 6:37

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.