如何在Hyperledger Fabric中编写自己的共识? [英] How to code own consensus in Hyperledger Fabric?

查看:385
本文介绍了如何在Hyperledger Fabric中编写自己的共识?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Hyperledger Fabric.但是我需要一个特殊的共识算法.我已经准备好了这个概念,但不知道如何在Fabric中实现它.

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.

文档说:

共识插件需要实现共识和链 共识包中定义的接口.有两个插件 已针对这些界面构建:solo和kafka.你可以学习 他们会为自己的实施提供线索.订购服务 代码可以在订购包中找到.

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.

第一个问题:是否可以编写我自己的共识方法并在Hyperledger Fabric中运行?第二:如果是,我应该如何开始?

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

推荐答案

我认为您已经回答了自己的问题. Hyperledger Fabric中的共识算法由订购服务实现.因此,要实现新算法,您需要编写一个新的共识包,将其添加到Ordering服务中,并构建一个新的Fabric运行时分支.

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.

使用现有的实现之一作为起点(solo或kafka),然后开始吧! :)

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

这篇关于如何在Hyperledger Fabric中编写自己的共识?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆