I have installed hyperledger composer locally. But on localhost it gives error :
Error : Error trying to ping.
Error: No business network has been specified for this connection.
I am not able to add model and script file as well.
This is the errors showing in terminal
error: [Hyperledger-Composer] undefined:HLFConnection :ping() Error: Error trying to ping. Error: No business network has been specified for this connection
at _checkRuntimeVersions.then.catch (/usr/local/lib/node_modules/composer-playground/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:787:34)
at <anonymous>
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9) error: [Hyperledger-Composer] undefined:ConnectorServer :Error: Error trying to pi
I got the same issue here. I'm not sure what's wrong(maybe because I fail to create a business network last time). But since the playground store the data with browser local storage. I simply clear the local storage and fix it.
Noticed composer wasnt running in the terminal. Run
composer-playground
in the terminal and retry.I think I solved this problem.
About the error
The error reason is
No business network has been specified for this connection.
, this does not happen when you first time to runcomposer-playground
, because that time, you truly do not have a network and you either do not have card too, so there is a modal pop upLet's blockchain
.This only happened when you stop/delete your business network net, or there is no business network running but you also have the business card linked to the network.
Solution
business network
locallystopFabric.sh
andstartFabric.sh
, (* this is not to start your business network but your fabric)composer-playground
error trying to ping
), but no worryMy Business Networks
delete the card without connection
ordeploy a new network
This worked for me, hope it will work for you too. This kind of process design limitation, the card is still there even you delete your network or your are trying to start your playground even you did not start your network. This is why this error happened I think.
Addition, More about playground
How to delete cache in browser Chrome
This probably can solve many errors.
References
I had the same issue and it got fixed. Clear the cache of your browser and refresh the page!