Search code examples
blockchainhyperledger-fabrichyperledgerhyperledger-composer

Hyperledger Composer: Error: Error trying to ping. Error: Error trying to query business network. Error: Connect Failed


I'm following this link: Hyperledger Composer Queries Tutorial to update an existing business network. Till step:3 everything working fine for me. But whenever I am executing step:4 (2) command I'm getting some error.

This is the error:

Error: Error trying to ping. Error: Error trying to query business network. Error: Connect Failed Command failed

Not sure why I'm getting the above error. It seems the business network is somehow not reachable.

Possibly I was getting the error as Fabric was not running in background. But after running the Fabric the error is slightly different. Here is the current error I am getting:

Error: Error trying to ping. Error: Error trying to query business network. Error: could not find chaincode with name 'tutorial-network' - make sure the chaincode tutorial-network has been successfully instantiated and try again Command failed


Solution

  • The network should be up and running then only you will be able to update it. Otherwise you will get some error and won't be able to update it.

    So I ran the following command before updating it as mentioned in the question and it works well.

    composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile tutorial-network@0.0.1.bna --file networkadmin.card