使用自己的ca服务器而非密码元在策略中启用对等,客户端,管理员角色

问题描述 投票:0回答:1

我已经通过使用Fabric Ca服务器和Ca客户二进制文件生成证书来成功创建了一个网络。但是我只能在configtx.yaml中使用以下策略。

Readers:
Type: Signature
Rule: "OR('abcMSP.member')"
Writers:
Type: Signature
Rule: "OR('abcMSP.member')"
Admins:
Type: Signature
Rule: "OR('abcMSP.member')"

但是我想使用如下所示的节点式。

Readers:
Type: Signature
Rule: "OR('abcMsp.admin', 'abcMsp.peer', 'abcMsp.client')"
Writers:
Type: Signature
Rule: "OR('abcMsp.admin', 'abcMsp.client')"
Admins:
Type: Signature
Rule: "OR('abcMsp.admin','abcMsp.client')"

下面是我在config.yaml中添加到msp文件夹的内容。

NodeOUs:
  Enable: true
  ClientOUIdentifier:
    Certificate: "cacerts/ca.pem"
    OrganizationalUnitIdentifier: "client"
  PeerOUIdentifier:
    Certificate: "cacerts/ca.pem"
    OrganizationalUnitIdentifier: "peer"
  AdminOUIdentifier:
    Certificate: "cacerts/ca.pem"
    OrganizationalUnitIdentifier: "admin"

将生成以下错误筏订购服务服务器引发的错误。

Failed validating bootstrap block: initializing channelconfig failed: could not create
channel Consortiums sub-group config: setting up the MSP manager failed: admin 0 is invalid: 
The identity is not valid under this MSP [abcMSP]: could not validate identity's OUs: the 
identity must be a client or a peer identity to be valid, not a combination of them. OUs:
hyperledger-fabric ca
1个回答
0
投票

您的管理员在其证书(或类似名称)中同时具有OU=clientOU=peer时,必须仅具有OU=admin。考虑到隶属关系和部门也包含在OU中,因此我敢打赌,您有一些隶属关系或部门称为clientpeer。如果是这种情况,请更改从属或部门名称并重新部署。

而且,在CA中注册管理员时,请记住指定类型admin,而不是client

fabric-ca-client register -d --id.name $ORG_ADMIN --id.secret $ORG_ADMIN_PASSWORD --id.type admin --id.affiliation $ORG_AFFILIATION
© www.soinside.com 2019 - 2024. All rights reserved.