Error: endorsement failure during invoke. response: status:500 message:"error in simulation:

Error: endorsement failure during invoke. response: status:500 message:"error in simulation:

我正在使用 hyperledger fabric 2.0。我有两个组织。 ORGAORGB。我正在使用 fabric-samples 存储库的“测试网络”作为我的网络。 我通过更改 fabcar.js 链代码的初始化函数和其他函数中的变量名称来编辑 javascript 版本的 fabcar 链代码。 我已经在两个组织的同行上安装了我编辑过的链码。我还成功批准了 2 个组织的链码。已成功将链代码定义提交到通道。但是,当我尝试使用带有函数 initLedger 的命令调用链代码时,出现错误:

命令:

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n deed --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --isInit -c '{"function":"initLedger","Args":[]}' 

我收到如下所示的错误:

Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 5b14718ab2408cd29dafc9daf33e193534c7a1262afebd0ca5eae3b0116aeca0: could not launch chaincode deed_1:48b197c4e734f589019d61ba1615ad9fc2b0007f478ab92a8b34714bc3c404e0: chaincode registration failed: container exited with 1"

帮帮我。 问候, 萨蒂什

错误告诉您托管链代码的容器在链代码进程以退出代码 1 终止后退出。如果您已配置对等点以流式传输链代码容器日志 (vm.docker.attachStdout=true / CORE_VM_DOCKER_ATTACHSTDOUT=true),您可以查看对等日志以了解链代码产生的任何错误。

检查你的链代码,它们是你代码中的一些拼写错误。 检查 --> 修复 --> 运行 以下脚本 -->

./startFabric.sh javascript

Fabric 在 Fabric 样本 (https://hyperledger-fabric.readthedocs.io/en/latest/deploy_chaincode.html#setup-logspout-optional)

中提供 monitordocker.sh 及其商业票据样本

运行 单独的 PUTTY window 中的以下行,以持续监控 docker 中所有容器的日志。注意“fabric_test”是需要监控的网络名称。

./monitordocker.sh fabric_test

现在 运行 导致错误的 fabric 命令,您应该在另一个 PUTTY window.

的日志中看到详细信息

调用的链代码的名称与提交的链代码的名称不匹配。 检查一下。