How to use the Inherent Extrinsics Feature in Substrate
A Block producer node has a feature to add an extrinsic to a block it produces. These are called inherent extrinsics. AURA for example passes the timestamp and the slot index to the runtime as inherent extrinsics. In this tutorial you'll implement your custom inherent provider as well as a pallet which eventually creates an extrinsic call using the inherent data passed from the client.
Time of completion
- 2-4 hrs
What you'll learn
- step-by-step guidance of implementing an extrinsic creation by a block authoring node.
- leverage the standard Substrate's Template Node to build a custom inherent provider and create an inherent extrinsic by the block authoring node.
- implement a custom InherentDataProvider on the Node (Client) side
- share InherentData from the Client to the Runtime
- construct an inherent on the Runtime and create an extrinsic call
- handling a Inherent as a special type of Unsigned Extrinsic
- this is an example of one aspect of data exchange between Outer Node and Runtime
Prerequisites
- knowledge of Rust programming language
- acquaintance with Substrate's concepts such as Client, Runtime, Scale codec, block production, extrinsic etc
- basic experience with compiling and running the Node Template CLI and Polkadot JS web client