我已经通过使用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:
您的管理员在其证书(或类似名称)中同时具有OU=client
和OU=peer
时,必须仅具有OU=admin
。考虑到隶属关系和部门也包含在OU
中,因此我敢打赌,您有一些隶属关系或部门称为client
或peer
。如果是这种情况,请更改从属或部门名称并重新部署。
而且,在CA中注册管理员时,请记住指定类型admin
,而不是client
:
fabric-ca-client register -d --id.name $ORG_ADMIN --id.secret $ORG_ADMIN_PASSWORD --id.type admin --id.affiliation $ORG_AFFILIATION