问题
I'm using fabric tools provided for composer to deploy fabric network as it deploys 1 peer, 1 orderer, 1 couchdb, & 1 fabric-ca. I am able to install chain code on peer but instantiation fails with following error. I am using command on fabric-peer.
peer chaincode instantiate -o orderer.example.com:7050 -C composerchannel -n test -l node -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}'
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 83b806a14ec33d47e11950581357cc0ab05ef51dfb53d35c6b9f00eca7a49051: timeout expired while starting chaincode test:1.0 for transaction 83b806a14ec33d47e11950581357cc0ab05ef51dfb53d35c6b9f00eca7a49051
And if I check the logs of orderer I get:
2018-09-01 11:09:16.205 UTC [orderer/common/broadcast] Handle -> WARN 973 Error reading from 172.19.0.14:33674: rpc error: code = Canceled desc = context canceled
回答1:
Check logs on node (VM) which host peer0 with:
docker ps -a
you will find chaincode container ID with exit code.
CONTAINER ID: **718e367bf1db**
IMAGE: dev-peer1-org1-**mycc-0.2**-9c1906
COMMAND: "/bin/sh -c 'cd /usr…"
where mycc-0.2 is you chaincode name and version.
Once you find the container ID - you can check the error log with:
docker logs <container_id>
I assume there is a bug in the your chaincode and the application can't start.
回答2:
in my case (windows 10) I stopped the network, removed all containers then restarted, worked fine:
$ docker stop $(docker ps -a -q)
$ docker ps -qa|xargs docker rm
$ ./startFabric.sh
来源:https://stackoverflow.com/questions/52127669/hyperledger-fabric-chaincode-instantiation-error