2

How to find the block author in pow substrate chain?

2 Answers 2

1

Integrate this pallet into your runtime.

https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/authorship/src/lib.rs

Then you can use T::FindAuthor::find_author() to get the block author in code level.

2
1

Please take a look of this implementation: https://github.com/kulupu/kulupu/blob/d9428305d1155514574df79a4692a48711c2bcb2/src/service.rs#L323C1-L324C1

Here in the service.rs we have passed the author by generating miner id in decode_author function: https://github.com/kulupu/kulupu/blob/d9428305d1155514574df79a4692a48711c2bcb2/src/service.rs#L61C1-L107C1

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.