2017-10-05 40 views
2

我正在使用Ubuntu 14.04的虚拟机上的本教程http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html,并运行脚本 ./byfn.sh -m up以调出网络。当我运行该安装chaincode:在HyperLedger结构上安装链码时出错

peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 

我得到以下错误:

Error: Error endorsing chaincode: rpc error: code = Unknown desc = chaincode error (status: 500, message: Error installing chaincode code mycc:1.0(chaincode /var/hyperledger/production/chaincodes/mycc.1.0 exists)) 

我该如何解决这个问题?

注:我也跑docker exec -it cli bash

+0

您能否请添加对等容器的日志? –

+0

你的意思是这样的:http://prntscr.com/gtzd3a ?? –

+0

您是否已经安装链码?错误消息似乎表明如此...... –

回答

4

好吧,虽然我不是100%肯定,因为没有提供足够的信息。因此,基于在评论规定,并基于错误您的日志快照你有:

Error: Error endorsing chaincode: rpc error: code = Unknown desc = chaincode error (status: 500, message: Error installing chaincode code mycc:1.0(chaincode /var/hyperledger/production/chaincodes/mycc.1.0 exists))

您尝试与重叠由byfn.sh脚本安装chaincode的名字命名安装chaincode。您可以在script.sh看到:

尝试在改变chaincode名install命令,以不同的东西,如:

peer chaincode install -n myNewCC -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 

另一种可能是禁用的script.sh执行,但是你必须初始化和创建你自己的频道。请参阅here

+1

或者,您也可以安装具有相同但不同版本的链式代码。这将基本上启动一个新的链代码容器,并应该删除错误。你也可以通过执行'docker stop '然后'docker rm '来尝试停止并移除'mycc'容器。您可以通过执行docker ps -a来获取容器标识符。 – jarvis

+0

@jarvis是的你是正确的,很好的附加组件,谢谢扩展我的回答:) –