实例化合约报错:chaincode registration failed 20C

环境是用fabric1.4.2 + raft 共识机制
3台raft+1台peer image 均启动正常

在实例化链码时候报错,请各位大咖帮我看看,如何解决,谢谢

1、实例化链码

peer chaincode instantiate -o orderer0.koko.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/koko.com/orderers/orderer0.koko.com/msp/tlscacerts/tlsca.koko.com-cert.pem -C kokochannel -n mycc -l golang -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P 'AND("Org1MSP.peer")'

2、cli容器报错:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 0图片说明

3、实例化合约peer docker 日志报错 信息

docker logs -f peer d4e4543te534r5
[kokochannel][52342533] Exit chaincode: name:"lscc" (44159ms)
2019-09-21 06:23:09.871 UTC [endorser] SimulateProposal -> ERRO 04c [kokochannel][52342533] failed to invoke chaincode name:"lscc" , error: container exited with 0
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
chaincode registration failed
2019-09-21 06:23:09.871 UTC [comm.grpc.server] 1 -> INFO 04d unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.19.0.1:39190 grpc.code=OK grpc.call_duration=44.161172022s图片说明

4、实例化合约 orderer docker 日志错误信息
docker logs -f 78ret8rere8retre

2019-09-21 06:04:23.367 UTC [common.deliver] deliverBlocks -> WARN 039 [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46044 because of consenter error
2019-09-21 06:04:23.372 UTC [comm.grpc.server] 1 -> INFO 03a streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46044 grpc.code=OK grpc.call_duration=197.489105ms
2019-09-21 06:04:23.591 UTC [common.deliver] deliverBlocks -> WARN 03b [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46046 because of consenter error
2019-09-21 06:04:23.643 UTC [comm.grpc.server] 1 -> INFO 03c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46046 grpc.code=OK grpc.call_duration=252.482946ms
2019-09-21 06:04:23.848 UTC [common.deliver] deliverBlocks -> WARN 03d [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46048 because of consenter error
2019-09-21 06:04:23.848 UTC [comm.grpc.server] 1 -> INFO 03e streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46048 grpc.code=OK grpc.call_duration=200.238916ms
2019-09-21 06:04:24.054 UTC [common.deliver] deliverBlocks -> WARN 03f [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46050 because of consenter error
2019-09-21 06:04:24.054 UTC [comm.grpc.server] 1 -> INFO 040 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46050 grpc.code=OK grpc.call_duration=201.471445ms
2019-09-21 06:04:24.260 UTC [common.deliver] deliverBlocks -> WARN 041 [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46052 because of consenter error
2019-09-21 06:04:24.260 UTC [comm.grpc.server] 1 -> INFO 042 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46052 grpc.code=OK grpc.call_duration=201.238803ms
2019-09-21 06:04:24.295 UTC [orderer.consensus.etcdraft] Step -> INFO 043 1 [logterm: 1, index: 3, vote: 0] cast MsgPreVote for 2 [logterm: 1, index: 3] at term 1 channel=kokochannel node=1
2019-09-21 06:04:24.339 UTC [orderer.consensus.etcdraft] Step -> INFO 044 1 [term: 1] received a MsgVote message with higher term from 2 [term: 2] channel=kokochannel node=1
2019-09-21 06:04:24.339 UTC [orderer.consensus.etcdraft] becomeFollower -> INFO 045 1 became follower at term 2 channel=kokochannel node=1
2019-09-21 06:04:24.339 UTC [orderer.consensus.etcdraft] Step -> INFO 046 1 [logterm: 1, index: 3, vote: 0] cast MsgVote for 2 [logterm: 1, index: 3] at term 2 channel=kokochannel node=1
2019-09-21 06:04:24.343 UTC [orderer.consensus.etcdraft] run -> INFO 047 raft.node: 1 elected leader 2 at term 2 channel=kokochannel node=1
2019-09-21 06:04:24.344 UTC [orderer.consensus.etcdraft] serveRequest -> INFO 048 Raft leader changed: 0 -> 2 channel=kokochannel node=1
2019-09-21 06:04:24.498 UTC [common.deliver] Handle -> WARN 049 Error reading from 192.168.213.134:46054: rpc error: code = Canceled desc = context canceled
2019-09-21 06:04:24.498 UTC [comm.grpc.server] 1 -> INFO 04a streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46054 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=233.075631ms
2019-09-21 06:23:09.917 UTC [orderer.common.broadcast] Handle -> WARN 04b Error reading from 192.168.213.134:46118: rpc error: code = Canceled desc = context canceled
2019-09-21 06:23:09.917 UTC [comm.grpc.server] 1 -> INFO 04c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=192.168.213.134:46118 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=44.160408206s图片说明

已解决

weixin_41730888
weixin_41730888 请问是怎么解决的
7 个月之前 回复
xoxzzz
xoxzzz 请问楼主怎么解决的,我现在也遇到一样的问题
9 个月之前 回复

3个回答

添加

--CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE = network_1.0

在peer容器启动依赖的yaml文件里。
like this
图片说明
其中圈起来的部分修改为你启动网络时的docker网络名称。
图片说明

修改完成后重新启动网络即可

qq_28104781
qq_28104781 谢谢 ,问题已经解决了
10 个月之前 回复

博主您好,请问下 我是自己建的项目 我用docker network ls 看自己的项目启动环境 ,我是需要文把peer件里的--CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE参数改成自己的启动网络名称吗,我改成自己的启动网络名称 再实例化合约的时候报的是:Error: could not send: EOF

weixin_43808675
frgreyre 我也是这个错,我是先重写了一遍 然后提示chaincode已存在 然后查询发现创建好了。应该是语句格式错le了
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问