Error Composer Rest Server - hyperledger-fabric

I have follow Hyperledger Composer here and all step is done.
But when i restart my PC and try to connect to Hyperledger Composer via command 'composer-rest-server' have error like this:
enter image description here
Discovering types from business network definition ... Connection
fails: Error: Error trying to ping. Error: Error trying to query
business network. Error: Connect Failed It will be retried for the
next request. Exception: Error: Error trying to ping. Error: Error
trying to query business network. Error: Connect Failed Error:
Error trying to ping. Error: Error trying to query business network.
Error: Connect Failed
at _checkRuntimeVersions.then.catch (/home/linux-user/.nvm/versions/node/v8.9.4/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:713:34)
at <'anonymous'>
Please help! Thank You.

See this answer for restarting the underlying Fabric before starting the REST Server.

When you restart your system, you also shut down all running docker containers. Restart containers(your blockchain network) before launching composer rest server.

Related

error [connectors/v2/FabricGateway] Failed to perform query transaction [ReadAsset] using arguments

Can someone please help me with this problem.
error [connectors/v2/FabricGateway] Failed to perform query transaction [ReadAsset] using arguments [2_4], with error: Error: error in simulation: failed to execute transaction 9ca49b08603ab086104fec8777546bbbc24d826a3900136b4a0e66aadf4bb6e4: could not launch chaincode basic_1:9820659c595e662a849033ca23b4424e87a126e8f40b5f81ace59820b81fe8e7: chaincode registration failed: error starting container: error starting container: API error (404): network _test not found
The report has been generated but all the transactions has failed.
It looks like the chaincode's Docker container failed to start for some reason. You will need to use the docker logs command to inspect the logs for the failure reason. Use the docker ps -a command to see what containers are available, including stopped / failed containers. Both the chaincode container (if it exists) and peer container logs may hold useful information.

Error: Failed to connect before the deadline URL:grpc://localhost:7051

:~/Documents/test/education/LFS171x/fabric-material/tuna-app/$ node query.js
Store path:/home/*******/Documents/test/education/LFS171x/fabric-material/tuna-app/hfc-key-store
Successfully loaded user1 from persistence
2020-02-11T05:56:10.423Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpc://localhost:7051
Query has completed, checking results
error from query = Error: Failed to connect before the deadline URL:grpc://localhost:7051
at checkState (/home/******/Documents/test/education/LFS171x/fabric-material/tuna-app/node_modules/fabric-client/node_modules/grpc/src/client.js:883:16) {
connectFailed: true
}
Im experimenting Hyperledger Fabric, using this link for reference,
Successfully registered admin and user, using registerAdmin.js and registerUser.js.
I am currently facing this error after running node query.js.
I need help troubleshooting this error,
Error: Failed to connect before the deadline
URL:grpc://localhost:7051.
Platform: Ubuntu 18.04,
Experimenting hyperledger fabric using Local Environment.
Thanks in advance.

How to start Composer blockchain business network to Hyperledger Fabric (multiple organizations)?

Deploying a Hyperledger Composer blockchain business network to Hyperledger Fabric (multiple organizations) is working fine until i need to close my computer and try to connect again
I followed this tutorial=https://hyperledger.github.io/composer/v0.19/tutorials/deploy-to-fabric-multi-org
For the first time the command "composer-rest-server" worked fine but after there is an error and i am unable to connect again
That is the error:
To restart the REST server using the same options, issue the following command:
composer-rest-server -c alice#trade-network -n never -d n -w true
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: No peers available to query. last error was Error: Failed to connect before the deadline
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: No peers available to query. last error was Error: Failed to connect before the deadline
Error: Error trying to ping. Error: No peers available to query. last error was Error: Failed to connect before the deadline
at _checkRuntimeVersions.then.catch

Error reading from 192.168.1.164:44214: rpc error: code = Canceled desc = context canceled

i got this error when i am trying to connect peers running in different machines .I found this error in docker logs of orderer.There is an error in docker logs of peer2 running in different machine
Failed obtaining connection: Could not connect to any of the endpoints: [orderer.example.com:7050]
You can find the orderer.yaml file at fabric-samples/config folder.
Going through the fields and their respective comments in orderer.yaml and core.yaml can help you to understand the method of configuring the network(orderer/peer).
And here you can get the info related to TLS.

Handshake failed with fatal error SSL_ERROR_SSL in composer network ping

When I ping blockchain business network using composer network ping command getting following error:
Command :
ubuntu#pc:~/Yogendra/BlockChain/order-supply-chain-27-Feb-2018/order-supply-chain$ sudo composer network ping -c yogi#order-supply-chain
Error :
E0227 17:19:27.692776546 15301 ssl_transport_security.c:921]
Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed. E0227
17:19:27.708774523 15301 ssl_transport_security.c:921] Handshake
failed with fatal error SSL_ERROR_SSL: error:14090086:SSL
routines:ssl3_get_server_certificate:certificate verify failed. Error:
Error trying invoke business network. Error: Peer has rejected
transaction
'975aa720ec13a9ca2b58022e44d63cc69a815e802fd5495c904b5d44e9b2d251'
with code ENDORSEMENT_POLICY_FAILURE Command failed
The answer and comments in this post should help you if you are using Composer v0.16.x
This tutorial should help with the format of the connection.json file.
If you are using v0.17.x, you will need this version of the tutorial.
UPDATE:
Composer v0.19 is now the latest version with many enhancements and some breaking changes. The tutorial has been updated accordingly and the revised tutorial is here.

Resources