Hyperledger Fabric 开发生命周期

Hyperledger Fabric development lifecycle

我在想 "best" 为 HF 开发周期排序步骤的做法是什么?以下是按不同主题组织的一些问题。

1。网络基础设施规格:

  1. 一项业务的强制成员是什么 网络定义(组织、同行、CA)?
  2. 我们的业务网络中需要多少个梨 (bn)?
  3. 我知道语义 渠道和同行之间的关系,但我不确定 关于同行和组织之间的关系?还, 如果只有一个组织 (org1.example.com) 会使用 发达的网络,如何指定使用中的背书策略 案例(因为我们在 chaincode 中至少需要两个组织 实例化 命令规范)?

2。 SDK开发生命周期

  1. 当我们开发 SDK (Node.js) 时,为了与我们的 BN 交互,我们的 SDK 应用程序需要什么 CA 证书才能连接和发布链代码功能?
  2. 如何颁发SDK应用所需的CA证书?

3。链码开发生命周期

1.If 我正在使用 CLI docker 容器来管理我的 BN,git 将我的链代码克隆到 CLI 然后安装它是一个好习惯吗并将其实例化到某个对等节点?

2.After 我更改了我的 go 链码,我是否需要使用不同的 id 将它重新安装到同一个节点,或者我可以只更新我的链码的现有实例?

我的想法是让这个问题成为我们可以添加关于这三个主题的所有相关问题的地方,所以请编辑并添加其他问题!谢谢你的回答。

让我试着回答你的问题:

What are the mandatory members in one business network definition (organizations, peers, ca)?

唯一强制性的网络实体是对等点和排序服务。当然,要能够定义任何事物,您应该了解将要进行交易的组织的概念。每个这样的一方都希望有许多 运行 代表组织的链代码(智能合约)。 CA 需要颁发证书并将对等方和客户端身份绑定到某个组织。

How many pears do we need in our business network (bn)?

所需的点数完全取决于您的业务逻辑和要求,需要满足对可用性、可扩展性和信任模型(背书策略)的期望。

I am aware of the semantic in relationship between the channel and the peer, but I am not sure about the relationship between the peer and the organization?

Peer 是代表给定组织执行链代码的网络实体,增加了组织对执行结果正确性的信心。

Also, what if just one organization (org1.example.com) will use the developed network, how to specify the endorsement policy in that use case (since we need at least two organization in chaincode instantiate command specification)?

您不必至少有两个组织来定义背书策略,而使用一个组织有点多余,因为默认的背书策略是让渠道中的一些同行签署背书请求。

When we develop SDK (Node.js), in order to interact with our BN what are required CA certificates needed for our SDK app to be able to connect and issue chain-code functions?

您不需要 CA 证书,但您需要一个由根 CA 签名的客户端证书来证明客户端身份,并使对等端能够在客户端具有正确访问权限时进行验证。

How to issue the CA certificates needed for SDK app?

您可以使用 fabric-ca 注册使用并获取客户端证书,或者您可以简单地利用 cryptogen 为您生成客户端证书。

If I am using the CLI docker container for management of my BN, is it a good practice to git clone my chain-code to CLI and then to install it and instantiate it to certain peer node?

事情是这样的,peer cli 有点滥用,因为它的主要用途是在开发中快速测试和演示。与 Hyperledger Fabric 通信的正确方法是使用 SDK,例如您基本上需要实现一个客户端,该客户端能够根据您自己的逻辑和与您的应用程序相关的参数安装和实例化链代码。

After I change my go chain-code, do I need to install it again with the different id to the same peer, or I can just update the existing instance of my chain-code?

您有一个升级过程,在 Hyperledger Fabric 中有很好的介绍 documentation. Or you can see a short demo on video

My idea is to make this question sort of place where we can add all the relevant questions about these three topics, so please edit and add additional questions!

请考虑登录 Rocket.Chat 并使用 #fabric 频道提问。

此外,请查看 documentation,因为有关您的问题的大部分信息和详细信息都可以在那里找到,并且会不断更新。