【发布时间】:2019-05-19 16:39:10
【问题描述】:
我有 4 个组织:
- Org1 -- 2 对等
- Org2 -- 2 对等
- OrgCam -- 0 个对等方,1 个客户端
- OrgView -- 0 个对等方,1 个客户端
Org1 的对等节点上安装了一个链码,用于访问一些仅对 Org1 可用的私有数据。
作为 OrgCam 的客户,我想访问安装在 Org1 对等节点上的链码。
当我尝试这样做时:
const result = await contract.evaluateTransaction('getPoints','ID1');
出现这个错误
2019-05-19T15:20:20.084Z - error: [SingleQueryHandler]: evaluate: message=No peers available to query. Errors: [], stack=FabricError: No peers available to query. Errors: []
at SingleQueryHandler.evaluate (/home/zanna/fabric-samples/first-network/clientCode/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:39:17)
at Transaction.evaluate (/home/zanna/fabric-samples/first-network/clientCode/node_modules/fabric-network/lib/transaction.js:246:29)
at Contract.evaluateTransaction (/home/zanna/fabric-samples/first-network/clientCode/node_modules/fabric-network/lib/contract.js:172:39)
at main (/home/zanna/fabric-samples/first-network/clientCode/camera.js:41:39)
at <anonymous>, name=FabricError
Failed to evaluate transaction: FabricError: No peers available to query. Errors: []
我的问题是:即使我不是 Org1 的客户,我如何查询 Org1 的链码?
【问题讨论】:
-
大部分连接信息都存储在连接配置文件 json 中。你试过检查吗?
-
我不认为
connection.json是这里的问题,当我尝试使用 Org1 客户端查询 Org1 对等方时,一切正常。
标签: hyperledger-fabric hyperledger