从Hyperledger Composer v0.16升级到v0.20.2

时间:2018-10-19 18:33:28

标签: node.js authentication acl hyperledger-composer

我正在将教程从composer v0.16升级到composer v0.20.2,大部分升级都进行得很顺利,但是我遇到了无法解决的身份验证问题。我正在逐步创建和激活用户。在v0.16中,我执行了以下操作:

  • 将新成员添加到注册表中
  • 新会员的签发身份
  • 为新会员创建和导入卡
  • 使用新的会员ID ping商业网络

最后一步“激活”了该成员,以便他们可以在网络中进行富有成效的工作。在v0.20中,前3个步骤仍然可以正常工作,但是PING步骤现在返回以下错误:

transaction returned with failure: AccessException: 
Participant 'org.acme.Z2BTestNetwork.Buyer#rdd@xyz.com' does not have 'READ' access to resource
'org.hyperledger.composer.system.Network#zerotoblockchain-network@0.1.5'

我已将我的Permissions.acl文件简化为以下三个语句:

rule Z2BTestFullAccess {
    description: "Allow all participants access to all resources"
    participant: "org.acme.Z2BTestNetwork.Buyer"
    operation: READ
    resource: "org.hyperledger.composer.system.**"
    action: ALLOW
}

rule NetworkAdminUser {
    description: "Grant business network administrators full access to user resources"
    participant: "org.hyperledger.composer.system.NetworkAdmin"
    operation: ALL
    resource: "**"
    action: ALLOW
}

rule NetworkAdminSystem {
    description: "Grant business network administrators full access to system resources"
    participant: "org.hyperledger.composer.system.NetworkAdmin"
    operation: ALL
    resource: "org.hyperledger.composer.system.**"
    action: ALLOW
}

我可以进一步简化第一个规则为

rule Z2BTestFullAccess {
    description: "Allow all participants access to all resources"
    participant: "ANY"
    operation: ALL
    resource: "org.hyperledger.composer.system.**"
    action: ALLOW
}

但是它仍然失败,并显示相同的错误消息。

新卡的作曲者卡列表返回:

userName:            rdd-xyz.com
description:         
businessNetworkName: zerotoblockchain-network
identityId:          6c6eab0d11d26ccfc4a8164dbe971814d2120802e84d1b3b98b16ceb2cb80334
roles:               none
connectionProfile: 
  name:   hlfv1
  x-type: hlfv1
credentials:         Credentials set
新卡的

计算机网络ping返回与nodejs代码相同的错误。

如何确定此错误的根本原因,更重要的是,如何解决此问题?如果有帮助,很乐意为每个步骤添加代码段。

0 个答案:

没有答案