How to code own consensus in Hyperledger Fabric?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 07:12:17

问题


I want to use Hyperledger Fabric. But I need a special consensus algorithm. I have the concept ready but no idea how to get it implemented in Fabric.

The documentation says:

A consensus plugin needs to implement the Consenter and Chain interfaces defined in the consensus package. There are two plugins built against these interfaces already: solo and kafka. You can study them to take cues for your own implementation. The ordering service code can be found under the orderer package.

First question: Is it possible to code my own consensus method and run it in Hyperledger Fabric? Second: If yes, how should I start?


回答1:


I think you've just about answered your own question. The consensus algorithms in Hyperledger Fabric are implemented by the Ordering service. So, to implement a new algorithm, you would need to code a new consensus package, add this to the Ordering service, and a build a new fork of the fabric runtime.

Use one of the existing implementations as a starting point (solo or kafka), and have at it! :)



来源:https://stackoverflow.com/questions/53631929/how-to-code-own-consensus-in-hyperledger-fabric

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!