使用Kubernetes的Hyperledger Fabric:无法实例化Chaincode

时间:2018-08-28 14:02:19

标签: kubernetes hyperledger-fabric hyperledger minikube

我正在尝试在Kubernetes上部署Hyperledger Fabric。除了peer chaincode instantiate之外,其他所有功能都正常运行。每当我尝试实例化chaincode时,它都会等待大约10-15分钟,然后抛出超时错误,如下所示:

Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction b7ce8fa6259e6004481b829660dd2365f8503153047b3d9132393180e2591f0a: timeout expired while starting chaincode mycc:1.0 for transaction b7ce8fa6259e6004481b829660dd2365f8503153047b3d9132393180e2591f0a

在对等端,出现以下错误:

2018-08-28 12:55:10.122 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 04e[0m Error creating new Smart Contract: error trying to connect to local peer: context deadline exceeded[31m2018-08-28 12:55:10.121 UTC [shim] userChaincodeStreamGetter -> ERRO 001[0m context deadline exceeded
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 04f[0m error trying to connect to local peer
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 050[0m github.com/hyperledger/fabric/core/chaincode/shim.userChaincodeStreamGetter
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 051[0m  /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:111
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 052[0m github.com/hyperledger/fabric/core/chaincode/shim.Start
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 053[0m  /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:150
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 054[0m main.main
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 055[0m  /chaincode/input/src/github.com/chaincode/fabcar/go/fabcar.go:200
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 056[0m runtime.main
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 057[0m  /opt/go/src/runtime/proc.go:198
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 058[0m runtime.goexit
2018-08-28 12:55:10.123 UTC [dev-peer0.example.com-mycc-1.0] func2 -> INFO 059[0m  /opt/go/src/runtime/asm_amd64.s:2361
2018-08-28 12:55:10.166 UTC [dockercontroller] func2 -> INFO 05a[0m Container dev-peer0.example.com-mycc-1.0 has closed its IO channel

完整日志可在此处找到=> https://hastebin.com/ibukeyakax.coffeescript

任何建议/帮助都将不胜感激。

1 个答案:

答案 0 :(得分:2)

我找到了解决方案。 在环境中添加CORE_PEER_ADDRESSAUTODETECT变量可以解决此问题。

所以您应该添加

- name: CORE_PEER_ADDRESSAUTODETECT
  value: "true" 

进入您的环境