Ошибка при развертывании примера приложения переноса баланса - PullRequest
0 голосов
/ 12 октября 2018

Может ли кто-нибудь помочь мне исправить приведенную ниже проблему тайм-аута при создании экземпляра операции с цепочкой кодов в приложении переноса баланса, которое входит в состав fabric-samples?

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

Ответы [ 3 ]

0 голосов
/ 25 октября 2018

В документации есть проблема.

В полезной нагрузке JSON для команды instantiate отсутствует определение «peers».Должно быть:

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"]
}'
0 голосов
/ 17 июня 2019

Убедитесь, что у вас есть hyperledger/fabric-ccenv:<version> изображение.Требуется сформировать контейнер с цепочечным кодом во время создания цепочечного кода.

0 голосов
/ 15 октября 2018

Обычно инстанцирование занимает больше времени для выполнения, вы можете увеличить тайм-аут для инстанцирования в коде, В этой строке

let results = await channel.sendInstantiateProposal(request, 120000); 
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...