如何在 hyperledger fabric v1.0 中创建一个特定的节点 'endorsing peer'

How to make a particular peer 'endorsing peer' in hyperledger fabric v1.0

阅读 the official doc 后,我知道背书策略是在链代码实例化时使用“-P”标志定义的。

文档建议如下:-P "AND('Org1.member','Org2.member')" 然而,'member' 字段在网络中不可见-config.json.

谁能解释一下...

  1. 'member'在'Org1.member'
  2. 中代表什么
  3. 我们能不能像这样直接提到同行:"AND('Org1.peer2', 'Org2.peer1')"`
  4. 我们可以像这样用 ip 寻址对等点吗:"AND('localhost:7051', 'localhost:7052')"`
  1. What is a 'member' representing in the 'Org1.member'?

member 关键字是标识组织内角色的主体,因此例如 member 用于常规实体,而例如 admin 则表示要背书具有管理员权限的交易必须签名。

  1. Can we directly mention peers like this: "AND('Org1.peer2', 'Org2.peer1')"`

不,您不能在背书政策中直接提及同行。

  1. Can we address peers with ip like this: "AND('localhost:7051', 'localhost:7052')"`

而且你也不能使用端点。

为了将任何节点转变为某个链代码的背书节点,您必须在该节点上安装链代码,这样您就可以将背书请求转发给该节点。当然,假设它的通道部分和链代码正在该通道中实例化。

在 HLF v1.1 中启用了身份分类,因此现在可以在背书策略中指定 "peers"。来自官方文档: A principal is described in terms of the MSP that is tasked to validate the identity of the signer and of the role that the signer has within that MSP. Four roles are supported: member, admin, client, and peer. Principals are described as MSP.ROLE, where MSP is the MSP ID that is required, and ROLE is one of the four strings member, admin, client and peer. Examples of valid principals are 'Org0.admin' (any administrator of the Org0 MSP) or 'Org1.member' (any member of the Org1 MSP), 'Org1.client' (any client of the Org1 MSP), and 'Org1.peer' (any peer of the Org1 MSP). 虽然它不允许指定命名的对等点或端点