我一直在关注https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html的商业论文教程

当我通过运行以下命令实例化链码时

docker exec cliMagnetoCorp peer chaincode instantiate -n papercontract -v 0 -l node -c '{"Args":["org.papernet.commercialpaper:instantiate"]}' -C mychannel -P "AND ('Org1MSP.member')"

几分钟后出现以下错误
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg timeout expired while starting chaincode papercontract:0 for transaction

我一直在挖掘,似乎“dev-peer0.org1.example.com-papercontract-0”失败了

dev-peer0.org1.example.com-papercontract-0日志显示以下内容:
dev-peer0.org1.example.com-papercontract-0|npm ERR! path /usr/local/src/package.json
dev-peer0.org1.example.com-papercontract-0|npm ERR! code ENOENT
dev-peer0.org1.example.com-papercontract-0|npm ERR! errno -2
dev-peer0.org1.example.com-papercontract-0|npm ERR! syscall open
dev-peer0.org1.example.com-papercontract-0|npm ERR! enoent ENOENT: no such file or directory, open '/usr/local/src/package.json'
dev-peer0.org1.example.com-papercontract-0|npm ERR! enoent This is related to npm not being able to find a file.
dev-peer0.org1.example.com-papercontract-0|npm ERR! enoent
dev-peer0.org1.example.com-papercontract-0|
dev-peer0.org1.example.com-papercontract-0|npm ERR! A complete log of this run can be found in:
dev-peer0.org1.example.com-papercontract-0|npm ERR!     /root/.npm/_logs/2019-02-08T11_51_20_601Z-debug.log

已经停留了两天,任何帮助将不胜感激!

编辑:在此之前的步骤按预期顺利运行。
同样,第一个网络仿真(./byfn.sh up)运行得很好。

最佳答案

您需要在chaincode目录内的package.json。例如,chaincode目录名称为:./Chaincode,内部应为chaincode.js和package.json。
在package.json中,在开始时,在脚本中应放置“node chaincode.js”。那是因为对等方使用npm开始执行链码。

关于docker - Hyperledger Fabric-商业用纸教程-链码实例化错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54592077/

10-10 04:41