无法在 hyperledger-fabric node-sdk 上调用 'queryInstalledChaincodes'

unable to call 'queryInstalledChaincodes' on hyperledger-fabric node-sdk

根据 hyperledger-fabric node-sdk 文档这两个函数 'queryChannels' 和 'queryInstalledChaincodes' 必须由管理员调用。我是 能够访问 'queryChannels'(均来自客户端 class)但在访问 queryInstalledChaincodes,出现错误:

(状态:500,消息:对通道 getinstalledchaincodes 上的 GETINSTALLEDCHAINCODES 的授权已被拒绝,并出现错误无法验证提案的创建者在无通道检查策略期间满足本地 MSP 主体[管理员]:[此身份不是管理员] )

有人可以提出解决方案吗?提前致谢。

嗯,这是示例,您应该找出您为客户端使用的身份。

问题是您的结构 ACL 策略(在 configtx.yaml 中)已将链代码区域设置为管理员访问权限。 这意味着您应该使用管理员身份调用 queryInstalledChaincodes 函数。

更多信息请查看此页面: https://hyperledger-fabric.readthedocs.io/en/release-1.4/access_control.html#what-is-an-access-control-list

1 年 6 个月前也有人问过这个问题,所以我敢打赌你已经自己解决了,恭喜!