I am currently trying to successfully invoke a chaincode on an Hyperledger Fabric network using Docker Swarm, based on this example. My network is the following:
org1 with peer0.org1.com + 1 CA org1 + CLI org1 + orderer.example.com from ordererOrg on PC1
org2 with peer0.org2.com + 1 CA org2 on PC2
It seems that my network is working, but once a chaincode is instantiated on a peer then invoked, the operation is not propagated. E.g I insert data into the ledger, the chaincode container logs show that they process the data, the peer container used to invoke the chaincode seems to have correctly endorsed and simulated the query too. All of this using commands manually from inside the CLI.
peer0.org1.com container logs
2019-07-09 08:52:08.753 UTC [endorser] EndorseWithPlugin -> DEBU 3784 Entering endorsement for {plugin: escc, channel: mychannel, tx: 50732326bbe19c9eb8de42fa327ee67fc2c8102337ef96cdf9ca49fb7a0b7703, chaincode: fabcar}
2019-07-09 08:52:08.753 UTC [msp.identity] Sign -> DEBU 3785 Sign: plaintext: 0A2040CDC0100B7F12FA1505C311EF86...455254494649434154452D2D2D2D2D0A
2019-07-09 08:52:08.753 UTC [msp.identity] Sign -> DEBU 3786 Sign: digest: 5E7E6A043E851C3316B08F5CB4A05D31840D213793C55BF14EBE64213E852F84
2019-07-09 08:52:08.756 UTC [endorser] EndorseWithPlugin -> DEBU 3787 Exiting {plugin: escc, channel: mychannel, tx: 50732326bbe19c9eb8de42fa327ee67fc2c8102337ef96cdf9ca49fb7a0b7703, chaincode: fabcar}
2019-07-09 08:52:08.756 UTC [endorser] endorseProposal -> DEBU 3788 [mychannel][50732326] Exit
2019-07-09 08:52:08.756 UTC [lockbasedtxmgr] Done -> DEBU 3789 Done with transaction simulation / query execution [50732326bbe19c9eb8de42fa327ee67fc2c8102337ef96cdf9ca49fb7a0b7703]
2019-07-09 08:52:08.756 UTC [endorser] func1 -> DEBU 378a Exit: request from 10.0.0.4:34978
2019-07-09 08:52:08.756 UTC [comm.grpc.server] 1 -> INFO 378b unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.0.0.4:34978 grpc.code=OK grpc.call_duration=8.895639ms
A (successfully executed) query on the ledger then shows that the ledger state didn't change.
However, if I use the node SDK provided in the fabcar example from the official samples repo (invoke.js) to invoke the same chaincode operation I get an error:
node sdk error with node invoke.js
2019-07-09T09:22:03.277Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:1 - endorsement failed - Error: failed to execute transaction a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9: error sending: txid: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9(mychannel) exists
Failed to submit transaction: Error: Endorsement has failed
peer0.org1.com container logs after node invoke
2019-07-09 09:22:03.273 UTC [endorser] callChaincode -> INFO 15480 [mychannel][a0a2570d] Entry chaincode: name:"fabcar"
2019-07-09 09:22:03.273 UTC [chaincode] Execute -> DEBU 15481 Entry
2019-07-09 09:22:03.273 UTC [chaincode] Execute -> DEBU 15482 Exit
2019-07-09 09:22:03.273 UTC [endorser] callChaincode -> INFO 15483 [mychannel][a0a2570d] Exit chaincode: name:"fabcar" (0ms)
2019-07-09 09:22:03.273 UTC [chaincode] handleMessage -> DEBU 15484 [a0a2570d] Fabric side handling ChaincodeMessage of type: PUT_STATE in state ready
2019-07-09 09:22:03.273 UTC [endorser] SimulateProposal -> ERRO 15485 [mychannel][a0a2570d] failed to invoke chaincode name:"fabcar" , error: txid: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9(mychannel) exists
github.com/hyperledger/fabric/core/chaincode.(*TransactionContexts).Create
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/transaction_contexts.go:59
github.com/hyperledger/fabric/core/chaincode.(*Handler).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/handler.go:1207
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:313
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:302
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:239
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:147
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:146
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:247
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:500
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler.func1
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:169
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:31
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor
/opt/gopath/src/github.com/hyperledger/fabric/core/comm/throttle.go:54
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor-fm
/opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:224
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpclogging/server.go:91
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:30
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:39
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:171
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:982
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1208
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:686
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
error sending
failed to execute transaction a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9
github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:245
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:240
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:147
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:146
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:247
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:500
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler.func1
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:169
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:31
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor
/opt/gopath/src/github.com/hyperledger/fabric/core/comm/throttle.go:54
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor-fm
/opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:224
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpclogging/server.go:91
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:30
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:39
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:171
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:982
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1208
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:686
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
2019-07-09 09:22:03.273 UTC [endorser] SimulateProposal -> DEBU 15486 [mychannel][a0a2570d] Exit
2019-07-09 09:22:03.273 UTC [lockbasedtxmgr] Done -> DEBU 15487 Done with transaction simulation / query execution [a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9]
2019-07-09 09:22:03.273 UTC [endorser] func1 -> DEBU 15488 Exit: request from 172.18.0.1:51702
2019-07-09 09:22:03.273 UTC [chaincode] HandleTransaction -> DEBU 15489 [a0a2570d] handling PUT_STATE from chaincode
2019-07-09 09:22:03.273 UTC [comm.grpc.server] 1 -> INFO 1548a unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.18.0.1:51702 grpc.code=OK grpc.call_duration=4.573006ms
2019-07-09 09:22:03.274 UTC [chaincode] HandleTransaction -> DEBU 1548b [a0a2570d] Completed PUT_STATE. Sending RESPONSE
2019-07-09 09:22:03.274 UTC [chaincode] handleMessage -> DEBU 1548c [a0a2570d] Fabric side handling ChaincodeMessage of type: PUT_STATE in state ready
2019-07-09 09:22:03.274 UTC [chaincode] HandleTransaction -> DEBU 1548d [a0a2570d] handling PUT_STATE from chaincode
2019-07-09 09:22:03.274 UTC [chaincode] HandleTransaction -> DEBU 1548e [a0a2570d] Completed PUT_STATE. Sending RESPONSE
2019-07-09 09:22:03.275 UTC [chaincode] handleMessage -> DEBU 1548f [a0a2570d] Fabric side handling ChaincodeMessage of type: COMPLETED in state ready
2019-07-09 09:22:03.275 UTC [chaincode] Notify -> DEBU 15490 [a0a2570d] notifying Txid:a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9, channelID:mychannel
2019-07-09 09:22:03.275 UTC [chaincode] Execute -> DEBU 15491 Exit
2019-07-09 09:22:03.275 UTC [endorser] callChaincode -> INFO 15492 [mychannel][a0a2570d] Exit chaincode: name:"fabcar" (3ms)
2019-07-09 09:22:03.275 UTC [lockbasedtxmgr] GetTxSimulationResults -> DEBU 15493 Simulation completed, getting simulation results
2019-07-09 09:22:03.275 UTC [lockbasedtxmgr] Done -> DEBU 15494 Done with transaction simulation / query execution [a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9]
2019-07-09 09:22:03.275 UTC [endorser] SimulateProposal -> DEBU 15495 [mychannel][a0a2570d] Exit
2019-07-09 09:22:03.275 UTC [endorser] endorseProposal -> DEBU 15496 [mychannel][a0a2570d] Entry chaincode: name:"fabcar"
2019-07-09 09:22:03.275 UTC [endorser] endorseProposal -> DEBU 15497 [mychannel][a0a2570d] escc for chaincode name:"fabcar" is escc
2019-07-09 09:22:03.275 UTC [endorser] EndorseWithPlugin -> DEBU 15498 Entering endorsement for {plugin: escc, channel: mychannel, tx: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9, chaincode: fabcar}
2019-07-09 09:22:03.275 UTC [msp.identity] Sign -> DEBU 15499 Sign: plaintext: 0A20828C242C3048295EE0453AD5EA85...455254494649434154452D2D2D2D2D0A
2019-07-09 09:22:03.275 UTC [msp.identity] Sign -> DEBU 1549a Sign: digest: F3BEDFED5C78408FD01F0A41C0714245508FD2F5AEF8A34F33E7F3C61DEFF987
2019-07-09 09:22:03.275 UTC [endorser] EndorseWithPlugin -> DEBU 1549b Exiting {plugin: escc, channel: mychannel, tx: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9, chaincode: fabcar}
2019-07-09 09:22:03.276 UTC [endorser] endorseProposal -> DEBU 1549c [mychannel][a0a2570d] Exit
2019-07-09 09:22:03.276 UTC [lockbasedtxmgr] Done -> DEBU 1549d Done with transaction simulation / query execution [a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9]
2019-07-09 09:22:03.276 UTC [endorser] func1 -> DEBU 1549e Exit: request from 172.18.0.1:51702
2019-07-09 09:22:03.276 UTC [comm.grpc.server] 1 -> INFO 1549f unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.18.0.1:51702 grpc.code=OK grpc.call_duration=6.750666ms
I tried some solutions found on SO such as:
having anchor peers set for each org: was already done
setting CORE_PEER_LISTENADDRESS=org1.example.com:7051 -> failed the peer containers. If I set the address to 0.0.0.0:7051 the containers starts again but the error stays the same
restarting Docker / removing volumes / redownloading images: didn't change a thing
Further points:
The orderer doesn't seem to be notified, as we can see in its logs.
When I use node invoke.js I sometimes get this error, which disappears when I launch the command again. Peer logs don't show an error.
node invoke.js inconsistent error
2019-07-09T14:13:21.232Z - error: [AbstractStrategy]: constructor: No event hubs for strategy
Failed to submit transaction: Error: No event hubs for strategy
When I query using node, I'll sometimes get the following error:
node query.js inconsistent error
2019-07-09T13:23:13.602Z - error: [SingleQueryHandler]: evaluate: message=No peers available to query. Errors: [], stack=FabricError: No peers available to query. Errors: []
at SingleQueryHandler.evaluate (/home/path_to_dir/app/javascript/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:39:17)
at Transaction.evaluate (/home/path_to_dir/app/javascript/node_modules/fabric-network/lib/transaction.js:246:29)
at Contract.evaluateTransaction (/home/path_to_dir/app/javascript/node_modules/fabric-network/lib/contract.js:172:39)
at main (/home/path_to_dir/app/javascript/query.js:47:39)
at <anonymous>, name=FabricError
Failed to evaluate transaction: FabricError: No peers available to query. Errors: []
This error usually disappears when I start a query again but will pop off from time to time. When the query comes from the CLIorg1 it never happens.
Some probably useful files:
configtx.yaml
crypto-config.yaml
docker-compose-org1.yaml
docker-compose-org2.yaml
EDIT: added insert.js file and logs after trying to node insert.js (see comments)
Configuration information
HLF 1.4.1 ; Docker 18.09.7 ; docker-compose 1.23.2 ; node v8.16.0 ; npm 6.4.1 ; Ubuntu 18.04.2 LTS
Apologies for the multitude of errors which makes the question broad, but I assume they are somehow all connected to an endorsement issue. If not, do not hesitate to edit / ping me to narrow it down.
Related
I am following the below link which outlines a GO example and runs fine, I am trying to alter it to run a nodejs smart contract.
https://hyperledger-fabric.readthedocs.io/en/latest/peer-chaincode-devmode.html#build-the-chaincode
For GO - works fine
go build -o simpleChaincode ./integration/chaincode/simple/cmd
CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_TLS_ENABLED=false
CORE_CHAINCODE_ID_NAME=mycc:1.0 ./simpleChaincode -peer.address
127.0.0.1:7052
For Nodejs
cd ./chaincode/asset-transfer-basic/chaincode-typescript
CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_TLS_ENABLED=false
CORE_CHAINCODE_ID_NAME=$CORE_CHAINCODE_ID_NAME npm run
start:server-debug -peer.address 127.0.0.1:7052
For Nodejs - in the peer logs
# 2022-04-05 16:30:56.427 PDT 013b DEBU [chaincode] CheckInvocation -> [0cda8fd8] getting chaincode data for cscc on channel
# 2022-04-05 16:30:56.427 PDT 013c DEBU [chaincode] Execute -> Entry
# 2022-04-05 16:30:56.428 PDT 013d INFO [ledgermgmt] CreateLedger -> Creating ledger [ch1] with genesis block
# 2022-04-05 16:30:56.429 PDT 013e DEBU [chaincode] handleMessage -> [0cda8fd8] Fabric side handling ChaincodeMessage of type: COMPLETED in state ready
# 2022-04-05 16:30:56.429 PDT 013f DEBU [chaincode] Notify -> [0cda8fd8] notifying Txid:0cda8fd80e6b204e45bfc10716924e689da5a2e50fc5c03de36692e3845a22a9, channelID:
# 2022-04-05 16:30:56.429 PDT 0140 DEBU [chaincode] Execute -> Exit
# 2022-04-05 16:30:56.429 PDT 0141 INFO [endorser] callChaincode -> finished chaincode: cscc duration: 1ms channel= txID=0cda8fd8
# 2022-04-05 16:30:56.429 PDT 0142 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=127.0.0.1:55599 grpc.code=OK grpc.call_duration=1.393458ms
Below messages for Peer are listed in GO but not in NodeJS
# 2022-04-05 16:30:56.822 PDT 0143 DEBU [chaincode] handleMessage -> [] Fabric side handling ChaincodeMessage of type: REGISTER in state created
# 2022-04-05 16:30:56.822 PDT 0144 DEBU [chaincode] HandleRegister -> Received REGISTER in state created
# 2022-04-05 16:30:56.822 PDT 0145 DEBU [chaincode] Register -> registered handler complete for chaincode mycc:1.0
# 2022-04-05 16:30:56.822 PDT 0146 DEBU [chaincode] HandleRegister -> Got REGISTER for chaincodeID = mycc:1.0, sending back REGISTERED
# 2022-04-05 16:30:56.822 PDT 0147 DEBU [chaincode] HandleRegister -> Changed state to established for mycc:1.0
# 2022-04-05 16:30:56.822 PDT 0148 DEBU [chaincode] sendReady -> sending READY for chaincode mycc:1.0
# 2022-04-05 16:30:56.822 PDT 0149 DEBU [chaincode] sendReady -> Changed to state ready for chaincode mycc:1.0
When I try to invoke the Nodejs chaincode
CORE_PEER_ADDRESS=127.0.0.1:7051 peer chaincode invoke -o
127.0.0.1:7050 -C ch1 -n $CC_NAME -c '{"Args":["InitLedger"]}' --isInit
I receive the below error which indicates that the peer is expecting the chaincode to installed in peer, but for devmode it should happen automatically.
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction edd6e811393cf4938a02b8d7773be85e57b5053ab5bfb2b38c06e8f88044d340: could not launch chaincode mycc-node:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'mycc-node:1.0': open /var/hyperledger/production/chaincodes/mycc-node.1.0: no such file or directory"
Any suggestions or guidance will be greatly appreciated.
Thanks
We are trying to instantiate the sample chaincode github.com/chaincode/chaincode_example02/go/ in a sample network, and we get the following error message... any suggestions where to look at?
CLI logs:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 0
Peer Logs:
2020-10-29 15:20:31.341 UTC [gossip.comm] sendToEndpoint -> DEBU 5ed1 Exiting
2020-10-29 15:20:31.397 UTC [chaincode] Launch -> DEBU 5ed2 stopping due to error while launching: 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
2020-10-29 15:20:31.397 UTC [container] lockContainer -> DEBU 5ed3 waiting for container(mycc-1.0) lock
2020-10-29 15:20:31.397 UTC [container] lockContainer -> DEBU 5ed4 got container (mycc-1.0) lock
2020-10-29 15:20:31.417 UTC [container] unlockContainer -> DEBU 5edb container lock deleted(mycc-1.0)
2020-10-29 15:20:31.417 UTC [chaincode] Launch -> DEBU 5edc launch complete
2020-10-29 15:20:31.417 UTC [chaincode] Deregister -> DEBU 5edd deregister handler: mycc:1.0
2020-10-29 15:20:31.417 UTC [endorser] callChaincode -> INFO 5ede [mychannel][502c46f0] Exit chaincode: name:"lscc" (35376ms)
2020-10-29 15:20:31.417 UTC [endorser] SimulateProposal -> ERRO 5edf [mychannel][502c46f0] 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
2020-10-29 15:20:31.417 UTC [endorser] SimulateProposal -> DEBU 5ee0 [mychannel][502c46f0] Exit
2020-10-29 15:20:31.417 UTC [lockbasedtxmgr] Done -> DEBU 5ee1 Done with transaction simulation / query execution [502c46f068a775e5966ee76e646b9444410e582877e12bd2b69aa89102061299]
2020-10-29 15:20:31.417 UTC [endorser] func1 -> DEBU 5ee2 Exit: request from 192.168.0.6:50290
The problem was caused by having a docker-compose network name which was not the default name (byfn).
It was fixed by adding the environ variable CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE to the right name
i'm studying the fabric ca operations guide document.
But when i trying to instantiate the chaincode , error occured.
Instantiate command:
peer chaincode instantiate -C mychannel -n mycc -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -o orderer1-org0:7050 --tls --cafile /tmp/hyperledger/org2/peer1/tls-msp/tlscacerts/tls-0-0-0-0-7052.pem
error message :
2020-02-21 04:13:57.176 UTC [grpc] switchBalancer -> DEBU 045 ClientConn switching balancer to "pick_first"
2020-02-21 04:13:57.176 UTC [grpc] HandleSubConnStateChange -> DEBU 046 pickfirstBalancer: HandleSubConnStateChange: 0xc0003c3d70, CONNECTING
2020-02-21 04:13:57.179 UTC [grpc] HandleSubConnStateChange -> DEBU 047 pickfirstBalancer: HandleSubConnStateChange: 0xc0003c3d70, READY
2020-02-21 04:13:57.179 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 048 Using default escc
2020-02-21 04:13:57.179 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 049 Using default vscc
2020-02-21 04:13:57.180 UTC [msp.identity] Sign -> DEBU 04a Sign: plaintext: 0AD8080A6608031A0B0885B2BDF20510...30300A000A04657363630A0476736363
2020-02-21 04:13:57.180 UTC [msp.identity] Sign -> DEBU 04b Sign: digest: 5480C64F725F648C381B7820B6EA079636CA6C6A8C1D51319B30116653888FF1
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg transaction returned with failure: Attribute 'abac.init' was not found
Can anyone explain to me? Thanks
Your Init function is being called when instantiating, but it is failing.
I suppose your chaincode is https://github.com/hyperledger/fabric-samples/blob/release-1.4/chaincode/abac/go/abac.go. The fact is that the requestor certificate should have the attribute "abac.init" to true, but yours haven't. That's defined during the Fabric CA registration and included in your enrolled certificate.
I am trying to run the Hyperledger Fabric for the first time.
Installed the binaries according to this:
https://hyperledger-fabric.readthedocs.io/en/release-1.4/install.html
Then trying to start the sample first network: https://hyperledger-fabric.readthedocs.io/en/release-1.4/build_network.html
I am running the: ./byfn.sh generate then: ./byfn.sh up
Unfortunately the the up command gives me this:
Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org1.example.com: no such host"
peer0.org1 failed to join the channel, Retry after 3 seconds
+ peer channel join -b mychannel.block
It seem that the: peer0.org1.example.com has quit, so
I've displayed its logs.
docker logs -f peer0.org1.example.com
2019-08-05 07:44:57.356 UTC [fsblkstorage] preRestHtFiles -> INFO 021 Dir [/var/hyperledger/production/ledgersData/chains/chains] missing... exiting
2019-08-05 07:44:57.356 UTC [fsblkstorage] LoadPreResetHeight -> INFO 022 Pre-reset heights loaded
2019-08-05 07:44:57.356 UTC [nodeCmd] func7 -> INFO 023 Starting profiling server with listenAddress = 0.0.0.0:6060
2019-08-05 07:44:57.364 UTC [comm.grpc.server] 1 -> INFO 024 unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2019-08-05T07:44:59.363Z grpc.peer_address=172.20.0.4:32800 grpc.peer_subject="CN=peer1.org1.example.com,L=San Francisco,ST=California,C=US" grpc.code=OK grpc.call_duration=131.772µs
2019-08-05 07:44:57.368 UTC [comm.grpc.server] 1 -> INFO 025 streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.request_deadline=2019-08-05T07:45:07.365Z grpc.peer_address=172.20.0.4:32800 grpc.peer_subject="CN=peer1.org1.example.com,L=San Francisco,ST=California,C=US" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=2.991758ms
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f6064357259]
It does look like it has received quit signal, because of: Dir [/var/hyperledger/production/ledgersData/chains/chains] missing
How do I proceed?
EDIT:
Since last line mentions that is an RPC error to: peer1.org1.example.com, below are the logs from: peer1.org1.example.com.
It seems that peer0 can't connect to peer1, whilst peer1 can't connect to peer0
2019-08-05 07:44:56.292 UTC [nodeCmd] serve -> INFO 001 Starting peer:
Version: 1.4.2
Commit SHA: c6cc550
Go version: go1.11.5
OS/Arch: linux/amd64
Chaincode:
Base Image Version: 0.4.15
Base Docker Namespace: hyperledger
Base Docker Label: org.hyperledger.fabric
Docker Namespace: hyperledger
2019-08-05 07:44:56.293 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2019-08-05 07:44:56.293 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2019-08-05 07:44:56.330 UTC [kvledger] NewProvider -> INFO 004 ledger provider Initialized
2019-08-05 07:44:56.373 UTC [ledgermgmt] initialize -> INFO 005 ledger mgmt initialized
2019-08-05 07:44:56.373 UTC [peer] func1 -> INFO 006 Auto-detected peer address: 172.20.0.4:8051
2019-08-05 07:44:56.373 UTC [peer] func1 -> INFO 007 Returning peer1.org1.example.com:8051
2019-08-05 07:44:56.373 UTC [peer] func1 -> INFO 008 Auto-detected peer address: 172.20.0.4:8051
2019-08-05 07:44:56.373 UTC [peer] func1 -> INFO 009 Returning peer1.org1.example.com:8051
2019-08-05 07:44:56.374 UTC [nodeCmd] serve -> INFO 00a Starting peer with TLS enabled
2019-08-05 07:44:56.376 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00b Entering computeChaincodeEndpoint with peerHostname: peer1.org1.example.com
2019-08-05 07:44:56.376 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00c Exit with ccEndpoint: peer1.org1.example.com:8052
2019-08-05 07:44:56.377 UTC [sccapi] registerSysCC -> INFO 00d system chaincode lscc(github.com/hyperledger/fabric/core/scc/lscc) registered
2019-08-05 07:44:56.378 UTC [sccapi] registerSysCC -> INFO 00e system chaincode cscc(github.com/hyperledger/fabric/core/scc/cscc) registered
2019-08-05 07:44:56.378 UTC [sccapi] registerSysCC -> INFO 00f system chaincode qscc(github.com/hyperledger/fabric/core/scc/qscc) registered
2019-08-05 07:44:56.378 UTC [sccapi] registerSysCC -> INFO 010 system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle,true) disabled
2019-08-05 07:44:56.380 UTC [gossip.service] func1 -> INFO 011 Initialize gossip with endpoint peer1.org1.example.com:8051 and bootstrap set [peer0.org1.example.com:7051]
2019-08-05 07:44:56.384 UTC [gossip.gossip] NewGossipService -> INFO 012 Creating gossip service with self membership of Endpoint: peer1.org1.example.com:8051, InternalEndpoint: peer1.org1.example.com:8051, PKI-ID: 54f785fe4477fcb3e57f7f5b817d6b542ff311ec1dd66dfb0ac2ac6abf50e08f, Metadata:
2019-08-05 07:44:56.384 UTC [gossip.gossip] start -> INFO 013 Gossip instance peer1.org1.example.com:8051 started
2019-08-05 07:44:56.385 UTC [sccapi] deploySysCC -> INFO 014 system chaincode lscc/(github.com/hyperledger/fabric/core/scc/lscc) deployed
2019-08-05 07:44:56.386 UTC [cscc] Init -> INFO 015 Init CSCC
2019-08-05 07:44:56.386 UTC [sccapi] deploySysCC -> INFO 016 system chaincode cscc/(github.com/hyperledger/fabric/core/scc/cscc) deployed
2019-08-05 07:44:56.387 UTC [qscc] Init -> INFO 017 Init QSCC
2019-08-05 07:44:56.387 UTC [sccapi] deploySysCC -> INFO 018 system chaincode qscc/(github.com/hyperledger/fabric/core/scc/qscc) deployed
2019-08-05 07:44:56.387 UTC [sccapi] deploySysCC -> INFO 019 system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle) disabled
2019-08-05 07:44:56.387 UTC [nodeCmd] serve -> INFO 01a Deployed system chaincodes
2019-08-05 07:44:56.388 UTC [discovery] NewService -> INFO 01b Created with config TLS: true, authCacheMaxSize: 1000, authCachePurgeRatio: 0.750000
2019-08-05 07:44:56.388 UTC [nodeCmd] registerDiscoveryService -> INFO 01c Discovery service activated
2019-08-05 07:44:56.388 UTC [nodeCmd] serve -> INFO 01d Starting peer with ID=[name:"peer1.org1.example.com" ], network ID=[dev], address=[peer1.org1.example.com:8051]
2019-08-05 07:44:56.388 UTC [nodeCmd] serve -> INFO 01e Started peer with ID=[name:"peer1.org1.example.com" ], network ID=[dev], address=[peer1.org1.example.com:8051]
2019-08-05 07:44:56.388 UTC [nodeCmd] func7 -> INFO 01f Starting profiling server with listenAddress = 0.0.0.0:6060
2019-08-05 07:44:56.388 UTC [kvledger] LoadPreResetHeight -> INFO 020 Loading prereset height from path [/var/hyperledger/production/ledgersData/chains]
2019-08-05 07:44:56.388 UTC [fsblkstorage] LoadPreResetHeight -> INFO 021 Loading Pre-reset heights
2019-08-05 07:44:56.388 UTC [fsblkstorage] preRestHtFiles -> INFO 022 Dir [/var/hyperledger/production/ledgersData/chains/chains] missing... exiting
2019-08-05 07:44:56.388 UTC [fsblkstorage] LoadPreResetHeight -> INFO 023 Pre-reset heights loaded
2019-08-05 07:44:57.365 UTC [comm.grpc.server] 1 -> INFO 024 unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2019-08-05T07:44:59.365Z grpc.peer_address=172.20.0.6:42872 grpc.peer_subject="CN=peer0.org1.example.com,L=San Francisco,ST=California,C=US" grpc.code=OK grpc.call_duration=160.286µs
2019-08-05 07:44:57.369 UTC [comm.grpc.server] 1 -> INFO 025 streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.request_deadline=2019-08-05T07:45:07.367Z grpc.peer_address=172.20.0.6:42872 grpc.peer_subject="CN=peer0.org1.example.com,L=San Francisco,ST=California,C=US" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=1.830335ms
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f39285ea259]
This answer solves the problem: https://stackoverflow.com/a/49649678/2263395
Basically you need to set the ENV variable: GODEBUG=netdns=go to docker-compose files.
I have made 2 instances by following a tutorial here. One is made in azure and one is made at AWS. I have successfully bridge the connection on the docker instance. When I tried to
composer network install --card PeerAdmin#hlfv1 --archiveFile stock-inquiry#0.0.1.bna
at amazon side, I get
composer network install --card PeerAdmin#hlfv1 --archiveFile stock-inquiry#0.0.1.bna
✖ Installing business network. This may take a minute...
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: Failed to connect before the deadline
Command failed
In azure side it works perfectly.
the logs at docker become like this
2018-12-18 07:48:53.536 UTC [nodeCmd] serve -> INFO 001 Starting peer:
Version: 1.1.0
Go version: go1.9.2
OS/Arch: linux/amd64
Experimental features: false
Chaincode:
Base Image Version: 0.4.6
Base Docker Namespace: hyperledger
Base Docker Label: org.hyperledger.fabric
Docker Namespace: hyperledger
2018-12-18 07:48:53.537 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2018-12-18 07:48:53.538 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2018-12-18 07:48:53.702 UTC [couchdb] handleRequest -> WARN 004 Retrying couchdb request in 125ms. Attempt:1 Error:Get http://couchdb:5984/: dial tcp 192.168.16.3:5984: getsockopt: connection refused
2018-12-18 07:48:53.828 UTC [couchdb] handleRequest -> WARN 005 Retrying couchdb request in 250ms. Attempt:2 Error:Get http://couchdb:5984/: dial tcp 192.168.16.3:5984: getsockopt: connection refused
2018-12-18 07:48:54.079 UTC [couchdb] handleRequest -> WARN 006 Retrying couchdb request in 500ms. Attempt:3 Error:Get http://couchdb:5984/: dial tcp 192.168.16.3:5984: getsockopt: connection refused
2018-12-18 07:48:54.580 UTC [couchdb] handleRequest -> WARN 007 Retrying couchdb request in 1s. Attempt:4 Error:Get http://couchdb:5984/: dial tcp 192.168.16.3:5984: getsockopt: connection refused
2018-12-18 07:48:55.581 UTC [couchdb] handleRequest -> WARN 008 Retrying couchdb request in 2s. Attempt:5 Error:Get http://couchdb:5984/: dial tcp 192.168.16.3:5984: getsockopt: connection refused
2018-12-18 07:48:57.680 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 009 Created state database _users
2018-12-18 07:48:57.711 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 00a Created state database _replicator
2018-12-18 07:48:57.733 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 00b Created state database _global_changes
2018-12-18 07:48:57.741 UTC [kvledger] NewProvider -> INFO 00c ledger provider Initialized
2018-12-18 07:48:57.741 UTC [ledgermgmt] initialize -> INFO 00d ledger mgmt initialized
2018-12-18 07:48:57.741 UTC [peer] func1 -> INFO 00e Auto-detected peer address: 192.168.16.5:7051
2018-12-18 07:48:57.751 UTC [peer] func1 -> INFO 00f Returning peer0.org1.stock.com:7051
2018-12-18 07:48:57.751 UTC [peer] func1 -> INFO 010 Auto-detected peer address: 192.168.16.5:7051
2018-12-18 07:48:57.751 UTC [peer] func1 -> INFO 011 Returning peer0.org1.stock.com:7051
2018-12-18 07:48:57.760 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 012 Entering computeChaincodeEndpoint with peerHostname: peer0.org1.stock.com
2018-12-18 07:48:57.760 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 013 Exit with ccEndpoint: peer0.org1.stock.com:7052
2018-12-18 07:48:57.761 UTC [nodeCmd] createChaincodeServer -> WARN 014 peer.chaincodeListenAddress is not set, using peer0.org1.stock.com:7052
2018-12-18 07:48:57.761 UTC [eventhub_producer] start -> INFO 015 Event processor started
2018-12-18 07:48:57.762 UTC [chaincode] NewChaincodeSupport -> INFO 016 Chaincode support using peerAddress: peer0.org1.stock.com:7052
2018-12-18 07:48:57.763 UTC [sccapi] registerSysCC -> INFO 017 system chaincode cscc(github.com/hyperledger/fabric/core/scc/cscc) registered
2018-12-18 07:48:57.763 UTC [sccapi] registerSysCC -> INFO 018 system chaincode lscc(github.com/hyperledger/fabric/core/scc/lscc) registered
2018-12-18 07:48:57.763 UTC [sccapi] registerSysCC -> INFO 019 system chaincode escc(github.com/hyperledger/fabric/core/scc/escc) registered
2018-12-18 07:48:57.764 UTC [sccapi] registerSysCC -> INFO 01a system chaincode vscc(github.com/hyperledger/fabric/core/scc/vscc) registered
2018-12-18 07:48:57.764 UTC [sccapi] registerSysCC -> INFO 01b system chaincode qscc(github.com/hyperledger/fabric/core/chaincode/qscc) registered
2018-12-18 07:48:57.765 UTC [gossip/service] func1 -> INFO 01c Initialize gossip with endpoint peer0.org1.stock.com:7051 and bootstrap set [127.0.0.1:7051]
2018-12-18 07:48:57.770 UTC [msp] DeserializeIdentity -> INFO 01d Obtaining identity
2018-12-18 07:48:57.773 UTC [gossip/discovery] NewDiscoveryService -> INFO 01e Started { [] [31 57 68 255 217 178 128 85 97 68 93 103 174 51 205 204 50 251 97 123 28 137 101 87 238 45 170 108 159 105 199 220] peer0.org1.stock.com:7051 <nil>} incTime is 1545119337773428448
2018-12-18 07:48:57.773 UTC [gossip/gossip] NewGossipService -> INFO 01f Creating gossip service with self membership of { [] [31 57 68 255 217 178 128 85 97 68 93 103 174 51 205 204 50 251 97 123 28 137 101 87 238 45 170 108 159 105 199 220] peer0.org1.stock.com:7051 <nil>}
2018-12-18 07:48:57.775 UTC [gossip/gossip] NewGossipService -> WARN 020 External endpoint is empty, peer will not be accessible outside of its organization
2018-12-18 07:48:57.778 UTC [gossip/gossip] start -> INFO 021 Gossip instance peer0.org1.stock.com:7051 started
2018-12-18 07:48:57.782 UTC [cscc] Init -> INFO 022 Init CSCC
2018-12-18 07:48:57.782 UTC [sccapi] deploySysCC -> INFO 023 system chaincode cscc/(github.com/hyperledger/fabric/core/scc/cscc) deployed
2018-12-18 07:48:57.783 UTC [sccapi] deploySysCC -> INFO 024 system chaincode lscc/(github.com/hyperledger/fabric/core/scc/lscc) deployed
2018-12-18 07:48:57.783 UTC [escc] Init -> INFO 025 Successfully initialized ESCC
2018-12-18 07:48:57.783 UTC [sccapi] deploySysCC -> INFO 026 system chaincode escc/(github.com/hyperledger/fabric/core/scc/escc) deployed
2018-12-18 07:48:57.784 UTC [sccapi] deploySysCC -> INFO 027 system chaincode vscc/(github.com/hyperledger/fabric/core/scc/vscc) deployed
2018-12-18 07:48:57.784 UTC [qscc] Init -> INFO 028 Init QSCC
2018-12-18 07:48:57.784 UTC [sccapi] deploySysCC -> INFO 029 system chaincode qscc/(github.com/hyperledger/fabric/core/chaincode/qscc) deployed
2018-12-18 07:48:57.784 UTC [nodeCmd] initSysCCs -> INFO 02a Deployed system chaincodes
2018-12-18 07:48:57.785 UTC [nodeCmd] serve -> INFO 02b Starting peer with ID=[name:"peer0.org1.stock.com" ], network ID=[dev], address=[peer0.org1.stock.com:7051]
2018-12-18 07:48:57.786 UTC [nodeCmd] serve -> INFO 02c Started peer with ID=[name:"peer0.org1.stock.com" ], network ID=[dev], address=[peer0.org1.stock.com:7051]
2018-12-18 07:49:04.193 UTC [ledgermgmt] CreateLedger -> INFO 02d Creating ledger [mychannel] with genesis block
2018-12-18 07:49:04.195 UTC [fsblkstorage] newBlockfileMgr -> INFO 02e Getting block information from block storage
2018-12-18 07:49:04.237 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 02f Created state database mychannel_
2018-12-18 07:49:04.278 UTC [kvledger] CommitWithPvtData -> INFO 030 Channel [mychannel]: Committed block [0] with 1 transaction(s)
2018-12-18 07:49:04.334 UTC [ledgermgmt] CreateLedger -> INFO 031 Created ledger [mychannel] with genesis block
2018-12-18 07:49:04.373 UTC [cscc] Init -> INFO 032 Init CSCC
2018-12-18 07:49:04.373 UTC [sccapi] deploySysCC -> INFO 033 system chaincode cscc/mychannel(github.com/hyperledger/fabric/core/scc/cscc) deployed
2018-12-18 07:49:04.374 UTC [sccapi] deploySysCC -> INFO 034 system chaincode lscc/mychannel(github.com/hyperledger/fabric/core/scc/lscc) deployed
2018-12-18 07:49:04.374 UTC [escc] Init -> INFO 035 Successfully initialized ESCC
2018-12-18 07:49:04.374 UTC [sccapi] deploySysCC -> INFO 036 system chaincode escc/mychannel(github.com/hyperledger/fabric/core/scc/escc) deployed
2018-12-18 07:49:04.374 UTC [sccapi] deploySysCC -> INFO 037 system chaincode vscc/mychannel(github.com/hyperledger/fabric/core/scc/vscc) deployed
2018-12-18 07:49:04.374 UTC [qscc] Init -> INFO 038 Init QSCC
2018-12-18 07:49:04.375 UTC [sccapi] deploySysCC -> INFO 039 system chaincode qscc/mychannel(github.com/hyperledger/fabric/core/chaincode/qscc) deployed
2018-12-18 07:59:56.451 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 03a Created state database mychannel_lscc
2018-12-18 07:59:56.457 UTC [lscc] executeInstall -> INFO 03b Installed Chaincode [stock-inquiry] Version [0.0.1] to peer
2018-12-18 08:01:31.970 UTC [endorser] ProcessProposal -> ERRO 03c [mychannel][d8bef524] simulateProposal() resulted in chaincode name:"lscc" response status 500 for txid: d8bef524455b7411da3b169efdf232bf50b8f17a7a7ddb3b4acd25ee413e8ae7
2018-12-18 08:02:45.646 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 03d Created state database mychannel_stock-inquiry
2018-12-18 08:02:45.657 UTC [cceventmgmt] HandleStateUpdates -> INFO 03e Channel [mychannel]: Handling LSCC state update for chaincode [stock-inquiry]
2018-12-18 08:02:45.682 UTC [couchdb] CreateIndex -> INFO 03f Created CouchDB index [selectCommoditiesByOwner] in state database [mychannel_stock-inquiry] using design document [_design/selectCommoditiesByOwnerDoc]
2018-12-18 08:02:45.685 UTC [couchdb] CreateIndex -> INFO 040 Created CouchDB index [selectCommoditiesByProductName] in state database [mychannel_stock-inquiry] using design document [_design/selectCommoditiesByProductNameDoc]
2018-12-18 08:02:45.687 UTC [couchdb] CreateIndex -> INFO 041 Created CouchDB index [selectCommodities] in state database [mychannel_stock-inquiry] using design document [_design/selectCommoditiesDoc]
2018-12-18 08:02:45.690 UTC [couchdb] CreateIndex -> INFO 042 Created CouchDB index [selectCommoditiesWithHighQuantity] in state database [mychannel_stock-inquiry] using design document [_design/selectCommoditiesWithHighQuantityDoc]
2018-12-18 08:02:45.722 UTC [kvledger] CommitWithPvtData -> INFO 043 Channel [mychannel]: Committed block [1] with 1 transaction(s)
2018-12-18 08:02:45.763 UTC [common/deliver] deliverBlocks -> WARN 044 [channel: mychannel] Error sending to 40.74.88.202:38350: rpc error: code = Unknown desc = the stream has been done
Then I continue to develop at azure side hoping to import the business card from azure side to amazon side, maybe then it will work perfectly. So I start creating a new business card and send it to amazon side. after I import the card and try to ping the business card, It gives me this message
Error: Error trying login and get user Context. Error: Error trying to enroll user. Error: Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 52.193.188.33:7054]
Command failed
They cannot ping each other because I haven't enabled ICMP at azure side. I have opened the ports so they can communicate each other.
inbound port settings for amazon side looks like this. Azure side looks almost the same, just differs at 7000 to 7100 become 8000 to 8100.
What should I do to install the business card? I am sure that the port is opened for each other to see.
Edit 1:
docker exec log at the start for azure side
# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.stock.com/msp" peer0.org1.stock.com peer channel create -o orderer.stock.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
2018-12-19 00:41:47.014 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-12-19 00:41:47.079 UTC [main] main -> INFO 002 Exiting.....
# Join peer0.org1.stock.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.stock.com/msp" peer0.org1.stock.com peer channel join -b mychannel.block
2018-12-19 00:41:47.352 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-12-19 00:41:47.562 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
2018-12-19 00:41:47.562 UTC [main] main -> INFO 003 Exiting.....
docker exec log at amazon side
# Create the channel
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.stock.com/msp" peer1.org1.stock.com peer channel fetch config -o orderer.stock.com:7050 -c mychannel
2018-12-19 00:42:11.228 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-12-19 00:42:11.254 UTC [cli.common] readBlock -> INFO 002 Received block: 0
2018-12-19 00:42:11.269 UTC [cli.common] readBlock -> INFO 003 Received block: 0
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.stock.com/msp" peer1.org1.stock.com peer channel join -b mychannel_config.block
2018-12-19 00:42:11.531 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-12-19 00:42:11.748 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
edit 3: if I want to install bna file at amazon side, it cannot be done.
it will give me this error
✖ Installing business network. This may take a minute...
Error: Error trying install business network. Error: The business network failed to install on 1 or more peers: Response from attempted peer comms was an error: Error: Failed to connect before the deadline
Command failed
On the other hand, if I install on azure side., I get error LSCC at azure side, but it will gives me a succeed message
2018-12-27 05:16:46.972 UTC [nodeCmd] serve -> INFO 001 Starting peer:
Version: 1.2.0
Commit SHA: cae2ad4
Go version: go1.10
OS/Arch: linux/amd64
Experimental features: false
Chaincode:
Base Image Version: 0.4.10
Base Docker Namespace: hyperledger
Base Docker Label: org.hyperledger.fabric
Docker Namespace: hyperledger
2018-12-27 05:16:46.972 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2018-12-27 05:16:46.972 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2018-12-27 05:16:47.114 UTC [couchdb] handleRequest -> WARN 004 Retrying couchdb request in 125ms. Attempt:1 Error:Get http://couchdb1:5984/: dial tcp 172.25.0.2:5984: connect: connection refused
2018-12-27 05:16:47.241 UTC [couchdb] handleRequest -> WARN 005 Retrying couchdb request in 250ms. Attempt:2 Error:Get http://couchdb1:5984/: dial tcp 172.25.0.2:5984: connect: connection refused
2018-12-27 05:16:47.492 UTC [couchdb] handleRequest -> WARN 006 Retrying couchdb request in 500ms. Attempt:3 Error:Get http://couchdb1:5984/: dial tcp 172.25.0.2:5984: connect: connection refused
2018-12-27 05:16:47.994 UTC [couchdb] handleRequest -> WARN 007 Retrying couchdb request in 1s. Attempt:4 Error:Get http://couchdb1:5984/: dial tcp 172.25.0.2:5984: connect: connection refused
2018-12-27 05:16:49.163 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 008 Created state database _users
2018-12-27 05:16:49.203 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 009 Created state database _replicator
2018-12-27 05:16:49.269 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 00a Created state database _global_changes
2018-12-27 05:16:49.344 UTC [kvledger] NewProvider -> INFO 00b ledger provider Initialized
2018-12-27 05:16:49.344 UTC [ledgermgmt] initialize -> INFO 00c ledger mgmt initialized
2018-12-27 05:16:49.344 UTC [peer] func1 -> INFO 00d Auto-detected peer address: 172.25.0.3:7051
2018-12-27 05:16:49.344 UTC [peer] func1 -> INFO 00e Returning peer1.org1.example.com:7051
2018-12-27 05:16:49.345 UTC [peer] func1 -> INFO 00f Auto-detected peer address: 172.25.0.3:7051
2018-12-27 05:16:49.345 UTC [peer] func1 -> INFO 010 Returning peer1.org1.example.com:7051
2018-12-27 05:16:49.346 UTC [eventhub_producer] start -> INFO 011 Event processor started
2018-12-27 05:16:49.347 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 012 Entering computeChaincodeEndpoint with peerHostname: peer1.org1.example.com
2018-12-27 05:16:49.347 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 013 Exit with ccEndpoint: peer1.org1.example.com:7052
2018-12-27 05:16:49.348 UTC [nodeCmd] createChaincodeServer -> WARN 014 peer.chaincodeListenAddress is not set, using peer1.org1.example.com:7052
2018-12-27 05:16:49.349 UTC [sccapi] registerSysCC -> INFO 015 system chaincode cscc(github.com/hyperledger/fabric/core/scc/cscc) registered
2018-12-27 05:16:49.349 UTC [sccapi] registerSysCC -> INFO 016 system chaincode lscc(github.com/hyperledger/fabric/core/scc/lscc) registered
2018-12-27 05:16:49.349 UTC [sccapi] registerSysCC -> INFO 017 system chaincode qscc(github.com/hyperledger/fabric/core/scc/qscc) registered
2018-12-27 05:16:49.354 UTC [gossip/gossip] NewGossipService -> INFO 018 Creating gossip service with self membership of { [] [211 55 188 245 219 253 179 85 254 143 15 136 54 239 192 58 60 153 254 80 243 208 48 137 183 237 162 71 84 184 182 206] peer1.org1.example.com:7051 <nil> <nil>}
2018-12-27 05:16:49.355 UTC [gossip/gossip] NewGossipService -> WARN 019 External endpoint is empty, peer will not be accessible outside of its organization
2018-12-27 05:16:49.355 UTC [gossip/gossip] start -> INFO 01a Gossip instance peer1.org1.example.com:7051 started
2018-12-27 05:16:49.356 UTC [cscc] Init -> INFO 01b Init CSCC
2018-12-27 05:16:49.356 UTC [sccapi] deploySysCC -> INFO 01c system chaincode cscc/(github.com/hyperledger/fabric/core/scc/cscc) deployed
2018-12-27 05:16:49.357 UTC [sccapi] deploySysCC -> INFO 01d system chaincode lscc/(github.com/hyperledger/fabric/core/scc/lscc) deployed
2018-12-27 05:16:49.357 UTC [qscc] Init -> INFO 01e Init QSCC
2018-12-27 05:16:49.357 UTC [sccapi] deploySysCC -> INFO 01f system chaincode qscc/(github.com/hyperledger/fabric/core/scc/qscc) deployed
2018-12-27 05:16:49.357 UTC [nodeCmd] serve -> INFO 020 Deployed system chaincodes
2018-12-27 05:16:49.358 UTC [discovery] NewService -> INFO 021 Created with config TLS: false, authCacheMaxSize: 1000, authCachePurgeRatio: 0.750000
2018-12-27 05:16:49.358 UTC [nodeCmd] registerDiscoveryService -> INFO 022 Discovery service activated
2018-12-27 05:16:49.358 UTC [nodeCmd] serve -> INFO 023 Starting peer with ID=[name:"peer1.org1.example.com" ], network ID=[dev], address=[peer1.org1.example.com:7051]
2018-12-27 05:16:49.359 UTC [nodeCmd] serve -> INFO 024 Started peer with ID=[name:"peer1.org1.example.com" ], network ID=[dev], address=[peer1.org1.example.com:7051]
2018-12-27 05:16:57.465 UTC [ledgermgmt] CreateLedger -> INFO 025 Creating ledger [mychannel] with genesis block
2018-12-27 05:16:57.478 UTC [fsblkstorage] newBlockfileMgr -> INFO 026 Getting block information from block storage
2018-12-27 05:16:57.533 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 027 Created state database mychannel_
2018-12-27 05:16:57.564 UTC [kvledger] CommitWithPvtData -> INFO 028 Channel [mychannel]: Committed block [0] with 1 transaction(s)
2018-12-27 05:16:57.564 UTC [pvtdatastorage] func1 -> INFO 029 Purger started: Purging expired private data till block number [0]
2018-12-27 05:16:57.565 UTC [pvtdatastorage] func1 -> INFO 02a Purger finished
2018-12-27 05:16:57.615 UTC [ledgermgmt] CreateLedger -> INFO 02b Created ledger [mychannel] with genesis block
2018-12-27 05:16:57.654 UTC [cscc] Init -> INFO 02c Init CSCC
2018-12-27 05:16:57.654 UTC [sccapi] deploySysCC -> INFO 02d system chaincode cscc/mychannel(github.com/hyperledger/fabric/core/scc/cscc) deployed
2018-12-27 05:16:57.654 UTC [sccapi] deploySysCC -> INFO 02e system chaincode lscc/mychannel(github.com/hyperledger/fabric/core/scc/lscc) deployed
2018-12-27 05:16:57.655 UTC [qscc] Init -> INFO 02f Init QSCC
2018-12-27 05:16:57.655 UTC [sccapi] deploySysCC -> INFO 030 system chaincode qscc/mychannel(github.com/hyperledger/fabric/core/scc/qscc) deployed
2018-12-27 05:17:03.656 UTC [gossip/election] beLeader -> INFO 031 [211 55 188 245 219 253 179 85 254 143 15 136 54 239 192 58 60 153 254 80 243 208 48 137 183 237 162 71 84 184 182 206] : Becoming a leader
2018-12-27 05:18:54.408 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 032 Created state database mychannel_lscc
2018-12-27 05:18:54.413 UTC [lscc] executeInstall -> INFO 033 Installed Chaincode [stock-inquiry] Version [0.0.2] to peer
2018-12-27 05:19:12.469 UTC [endorser] ProcessProposal -> ERRO 034 [][c4b74ceb] simulateProposal() resulted in chaincode name:"lscc" response status 500 for txid: c4b74cebeae32b1584387b0b12398c880a928723a8d200c205f3c96eff3e9dfc
problem fixed, amazon side cannot see himself. I need to open his own port connection to be seen by himself.