所需的链代码未安装在足够的对等点上

required chaincodes are not installed on sufficient peers

我正在 IBM Blockchain Platform 服务上使用 hyperledger fabric。我已经能够毫无问题地测试链代码,但是,在上次更新之后,我开始收到看起来很简单的错误 required chain codes are not installed on sufficient peers,但问题是链代码实际上已安装在所有对等方中。

Peer1 的日志

2021-10-28 20:12:53.535 UTC [lifecycle] CheckCommitReadiness -> INFO 111c Successfully
checked commit readiness of chaincode name 'test-cc' on channel 'testchannel2' with
definition {sequence: 5, endorsement info: (version: '0.0.9', plugin: 'escc', init
required: false), validation info: (plugin: 'vscc', policy:
'12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}

为 Peer2 登录

2021-10-28 20:12:25.575 UTC [lifecycle] CheckCommitReadiness -> INFO 7bf1 Successfully
checked commit readiness of chaincode name 'test-cc' on channel 'testchannel2' with
definition {sequence: 5, endorsement info: (version: '0.0.9', plugin: 'escc', init
required: false), validation info: (plugin: 'vscc', policy:
'12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}

然而,当我执行新提交的链代码时,我得到:

2021-10-28 20:20:00.004 UTC [discovery] chaincodeQuery -> ERRO 1126 Failed constructing
descriptor for chaincode chaincodes:<name:"test-cc" > ,: required chaincodes are not
installed on sufficient peers

有什么想法吗?

CheckCommitReadiness 只检查链代码定义是否已被批准。它不会检查链代码是否已实际安装在对等点上。为此使用 queryinstalled。如果您发现链代码确实安装在每个节点上,那么接下来要检查的是发现服务是否可以看到安装了链代码的每个节点。要检查这一点,请查看对等日志中的“成员视图”消息。如果“成员关系视图”不完整,则可能是对等点之间的八卦配置问题。

问题与我部署 CC 的方式有关。 IBM Blockchain 平台有一种方法可以在从另一个节点复制过来的节点上安装 CC,只需再次上传 CC(对于每个节点)。我再次尝试使用“从另一个”对等方法复制,它起作用了。所以,也许我在从笔记本电脑上传时选择了不同的版本。