We need to implement consensus service which will start running when node starts. This service will do some specific and core tasks for orchestrator. This service will decide the final consensus and persist only valid slots and block hashes of pandora and vanguard chain into its db.
Tasks
It is a service so it will be registered in node.
In the run method, it will run infinity loop and waiting on two separate channels(we can implement event based communication here instead of passing channels to pandorachain and vanguardchain package) for getting block and block header from vanguard and pandora.
Block from vanguard and block header from pandora will not come in the same time so, it start comparing when it gets the header and block. Let's say, it first gets pandora block header then it needs to wait for vanguard block. When vanguard block will come, it will start comparing.
Right now comparing will not happen so it just persist the blockHash and slot of pandora and vanguard blindly and remove the slot from two queue.
Overview
We need to implement consensus service which will start running when node starts. This service will do some specific and core tasks for
orchestrator
. This service will decide the final consensus and persist only valid slots and block hashes of pandora and vanguard chain into its db.Tasks
pandorachain
andvanguardchain
package) for getting block and block header from vanguard and pandora.Implementation Notes
Please provide implementation notes