Karaoke

For this exercise you may use substrate-node-template application.

Implement:

  • a new inherent data provider that puts a new line of song to an every block,

  • a new karaoke pallet that reads every song line from a block's inherents and emits an event that contains the line.

Relevant substrate parts:

Implementation hints:

  • Implement custom InherentDataProvider that proposes song lines. Use it in the aura block provider in service.rs,

  • implement a new pallet and implement ProvideInherent trait for it that takes a new line from the block and puts it into the blockchain storage, and then emits and event. Add this pallet to the runtime.

Note: prior to Substrate v4, it was only possible to do this task via implementing a wrapper for Proposer and ProposerFactory that puts a line of song to InherentData and use sc_basic_authorship::Proposer and sc_basic_authorship::ProposerFactory respectively to generate a block proposition, followed by using this wrapper instead of sc_basic_authorship::ProposerFactory in bin/node-template/node/src/service.

Last updated

Was this helpful?