Configure a chain to POW consensus
When you want to experiment with different consensus engines out there and wanna learn how it works. Start with the classics. WIP
#
GoalTo understand how link a POW consensus engine to a service client.
#
Use cases- Launching a POW chain.
- Upgrading a chain from Authority based to POW based.
#
OverviewThe basic-pow node demonstrates how to wire up a custom consensus engine into the Substrate Service. It uses a minimal proof of work consensus engine to reach agreement over the blockchain. This guide will teach us many useful aspects of dealing with consensus and prepare us to understand more advanced consensus engines in the future.
#
Stepssc_consensus_pow
and sc_service
#
1. Make a function that defines a full node using In src/service.rs
, make a function called new_full1
that defines PartialComponents
and
PowBlockImport
:
See the Rust docs on to configure the pow_block_import
function.
#
2. Create import queueDefine your node's inherents by using InherentDataProviders
in a function that defines the providers of your POW system:
proposer
and worker
#
3. Define the In the new_full
function, define proposer
:
Let the task manager spawn it:
#
4. Construct the light client's service.The construction of the light client service is quite similar to the construction of a new_full
.
#
Examples- Basic POW node
#
Resources#
Rust docs#
Knowledgebase- Knowledgebase article on inherents