Reputation: 13
How does consensus algorithm in hyperledger blockchain work?
Have all nodes access to the same chain code? If yes, what is the role of consensus then? And how does it works?
Upvotes: 1
Views: 351
Reputation: 73
In Hyper ledger fabric, consensus is achieved by three steps -
Endorsement, Ordering, and Validation.
You are talking about the first step that is endorsement.
If I get you correctly you are saying that if all the nodes have the same code then they will naturally give the same result after execution of the chain code, then why do we need consensus in the first place. In fact this is exactly why we need the consensus, we have to make sure that the result of the majority of the nodes is correct in order to eliminate any incorrect results (from the node which might be compromised).
have a detailed look here https://www.skcript.com/svr/consensus-hyperledger-fabric/
Upvotes: -1
Reputation: 2345
First be aware that there are different, independent Hyperledger blockchain platforms, including Hyperledger Fabric and Hyperledger Sawtooth.
For Hyperledger Sawtooth, and for blockchain software in general, the consensus algorithm decides who has the right to publish the next block in the blockchain (who becomes the "leader"). For traditional public blockchains (such as Bitcoin), the consensus algorithm is Proof of Work (PoW). That is, the node that solves a cryptographic puzzle first (generates a SHA-256 hash with the most leading 0s) wins the right to publish the next block. Unfortunately PoW is extremely wasteful of energy and active research is involved in developing new consensus algorithms.
Upvotes: 3