Reputation: 259
I tried installing and instantiating the chaincode_example02
chaincode on the network I brought up by modifying the byfn script from build your first network. I am using 2 orgs with 1 peer each. I renamed the orgs.
The peer containers are coming up and I am able to install the chaincode on the peers of both the orgs. When I am instantiating, the chaincode container comes up. The command does not return any error.
But I am unable to query the chaincode. I am unable to find the chaincode in peer chaincode list --instantiated -C mychannel
.
I have tried running the byfn script without any modifications and I was able to complete the end to end test.
peer log
2019-08-22 08:46:29.062 UTC [ConnProducer] NewConnection -> ERRO 038 Failed connecting to {localhost:7050 [OrdererMSP]} , error: context deadline exceeded
2019-08-22 08:46:29.063 UTC [ConnProducer] NewConnection -> ERRO 039 Could not connect to any of the endpoints: [{localhost:7050 [OrdererMSP]}]
2019-08-22 08:46:29.063 UTC [deliveryClient] connect -> ERRO 03a Failed obtaining connection: could not connect to any of the endpoints: [{localhost:7050 [OrdererMSP]}]
2019-08-22 08:46:29.064 UTC [deliveryClient] try -> WARN 03b Got error: could not connect to any of the endpoints: [{localhost:7050 [OrdererMSP]}] , at 1 attempt. Retrying in 1s
2019-08-22 08:46:30.099 UTC [endorser] callChaincode -> INFO 03c [][276fe51c] Entry chaincode: name:"lscc"
2019-08-22 08:46:30.103 UTC [lscc] executeInstall -> INFO 03d Installed Chaincode [mycc] Version [1.0] to peer
2019-08-22 08:46:30.103 UTC [endorser] callChaincode -> INFO 03e [][276fe51c] Exit chaincode: name:"lscc" (4ms)
2019-08-22 08:46:30.103 UTC [comm.grpc.server] 1 -> INFO 03f unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=192.168.0.5:54174 grpc.code=OK grpc.call_duration=5.100738ms
2019-08-22 08:46:30.200 UTC [endorser] callChaincode -> INFO 040 [ssidchannel][293c34bf] Entry chaincode: name:"lscc"
2019-08-22 08:46:30.220 UTC [chaincode.platform.golang] GenerateDockerBuild -> INFO 041 building chaincode with ldflagsOpt: '-ldflags "-linkmode external -extldflags '-static'"'
2019-08-22 08:46:33.066 UTC [ConnProducer] NewConnection -> ERRO 042 Failed connecting to {localhost:7050 [OrdererMSP]} , error: context deadline exceeded
2019-08-22 08:46:33.066 UTC [ConnProducer] NewConnection -> ERRO 043 Could not connect to any of the endpoints: [{localhost:7050 [OrdererMSP]}]
2019-08-22 08:46:33.066 UTC [deliveryClient] connect -> ERRO 044 Failed obtaining connection: could not connect to any of the endpoints: [{localhost:7050 [OrdererMSP]}]
orderer logs
2019-08-22 08:46:16.512 UTC [orderer.commmon.multichannel] newChain -> INFO 00b Created and starting new chain ssidchannel
2019-08-22 08:46:16.518 UTC [common.deliver] Handle -> WARN 00c Error reading from 192.168.0.5:47044: rpc error: code = Canceled desc = context canceled
2019-08-22 08:46:16.518 UTC [comm.grpc.server] 1 -> INFO 00d streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.0.5:47044 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=55.824801ms
2019-08-22 08:46:23.203 UTC [orderer.common.broadcast] Handle -> WARN 00e Error reading from 192.168.0.5:47060: rpc error: code = Canceled desc = context canceled
2019-08-22 08:46:23.203 UTC [comm.grpc.server] 1 -> INFO 00f streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=192.168.0.5:47060 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=22.774639ms
chaincode container logs
Aval = 100, Bval = 200
2019-08-22 08:20:10.458 UTC [shim] chatWithPeer -> ERRO 001 Received error from server, ending chaincode stream: rpc error: code = Unavailable desc = transport is closing
receive failed
github.com/hyperledger/fabric/core/chaincode/shim.chatWithPeer
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:362
github.com/hyperledger/fabric/core/chaincode/shim.Start
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:156
main.main
/chaincode/input/src/fabric-samples/chaincode/chaincode_example02/go/chaincode_example02.go:195
runtime.main
/opt/go/src/runtime/proc.go:201
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
Error starting Simple chaincode: receive failed: rpc error: code = Unavailable desc = transport is closing
Upvotes: 0
Views: 206
Reputation: 259
The chaincode container after spawning was getting connected to a different network than that of the peers and orderers. I changed the CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
property in the peer-base.yaml
file to match the network in the docker-compose-cli.yaml
file to fix this.
Upvotes: 1
Reputation: 4133
ERRO 044 Failed obtaining connection: could not connect to any of the endpoints: [{localhost:7050 [OrdererMSP]}]
Its clear indication that peer is not able to connect the orderer
[OrdererMSP] >> why this is present in the list of orderer endpoint? I assume that you have done something wrong
[{localhost:7050 [OrdererMSP]}]
<<< wrong representation
Please paste here peer manifest, orderer manifest, and configtx.yaml
In order to investigate the issue
Upvotes: 0