部署余额转移示例应用程序超账结构样本时出错

时间:2018-10-12 06:00:49

标签: hyperledger-fabric

有人可以帮助我解决以下超时问题,同时实例化结构样本的一部分的余额转移应用程序的链码操作吗?

recoveryParam: 0 }
error: [Peer.js]: sendProposal - timed out after:60000
error: [Peer.js]: sendProposal - timed out after:60000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
    at Timeout._onTimeout (/home/ubuntu/fabric-samples/balance-transfer/node_modules/fabric-client/lib/Peer.js:124:19)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
    at Timeout._onTimeout (/home/ubuntu/fabric-samples/balance-transfer/node_modules/fabric-client/lib/Peer.js:124:19)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
[2018-10-11 13:25:07.151] [ERROR] instantiate-chaincode - instantiate proposal was bad
[2018-10-11 13:25:22.593] [ERROR] instantiate-chaincode - instantiate proposal was bad
[2018-10-11 13:25:34.602] [DEBUG] instantiate-chaincode - Failed to send Proposal and receive all good ProposalResponse
[2018-10-11 13:25:45.807] [ERROR] instantiate-chaincode - Failed to instantiate. cause:Failed to send Proposal and receive all good ProposalResponse
(node:3678) UnhandledPromiseRejectionWarning: Error: Failed to instantiate. cause:Failed to send Proposal and receive all good ProposalResponse
    at Object.instantiateChaincode (/home/ubuntu/fabric-samples/balance-transfer/app/instantiate-chaincode.js:190:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:3678) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3678) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C

4 个答案:

答案 0 :(得分:1)

文档中存在问题。

实例化命令的JSON有效负载缺少“对等”定义。应该是:

curl -s -X POST \
  http://localhost:4000/channels/mychannel/chaincodes \
  -H "authorization: Bearer <put JSON Web Token here>" \
  -H "content-type: application/json" \
  -d '{
    "peers": ["peer0.org1.example.com","peer1.org1.example.com"],
    "chaincodeName":"mycc",
    "chaincodeVersion":"v0",
    "chaincodeType": "golang",
    "args":["a","100","b","200"]
}'

答案 1 :(得分:0)

通常,实例化将花费更多时间执行,您可以在代码In this line

中增加实例化的超时时间
let results = await channel.sendInstantiateProposal(request, 120000); 

答案 2 :(得分:0)

确保您拥有hyperledger/fabric-ccenv:<version>张图片。必须在链码实例化期间形成链码容器。

答案 3 :(得分:0)

我也遇到了同样的问题,请按照以下步骤进行修复

  1. 首先删除所有docker容器和图像。
  2. 重新启动docker
  3. 再次下载所有图像并增加app文件夹中的超时时间

    let results = await channel.sendInstantiateProposal(request,120000);

  4. 如果错误仍然存​​在,请尝试使用sudo运行./runApp.sh和./testAPI.sh。

相关问题