在 hyperledger fabric 中使用非管理卡和 composer-rest-server

Use non-admin card with composer-rest-server in hyperledger fabric

没有网络管理卡我无法启动composer-rest-server
当我尝试使用普通用户卡时,它会生成以下错误:

Connection fails: Error: 2 UNKNOWN: error executing chaincode:
transaction returned with failure:
AccessException: Participant 'com.tuzz.agloan.Dccb#dccb1' does not have 'READ' access to resource 'org.hyperledger.composer.system.Network#aloan@0.0.2-deploy.17'

您可以尝试添加允许参与者访问网络的规则。

在 .acl 文件中,添加此规则,然后更新网络并启动 REST 服务器

rule Rule1 {
   description: "Grant access to the network"
    participant: "com.tuzz.agloan.Dccb"
    operation: READ
    resource: "org.hyperledger.composer.system.Network"
    action: ALLOW
}

有关更多详细信息,您可以参考 ACL reference

中的授予网络访问控制部分