0
votes

The below are all the commands i executed.

1) $ .startFabric.sh <br/>
      SUCCESS <br/>
2) $ ./createPeerAdminCard.sh <br/>
      SUCCESS <br/>
3) $ composer archive create -t dir -n .  <br/>
      SUCCESS <br/>
4) $ composer network install --card PeerAdmin@hlfv1 --archiveFile [email protected] <br/>
      SUCCESS <br/>
5) $composer network start --networkName carauction-network --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card --networkVersion 0.19.5 <br/><br/>

Error as below:

Starting business network carauction-network at version 0.19.5
Processing these Network Admins:
userName: admin
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (carauction-network:0.19.5)) Command failed

2

2 Answers

1
votes

It looks live you have specified the version of the composer code you installed v0.19.5 instead of the Business Network Version of the carauction network.

You should see the Business Network Version as output of the "composer network install" command, but if that has disappeared, you can use composer archive list -a [email protected] to confirm the version. (this is also the version number in the package.json file)

0
votes

Before you can start a business network, you need to ensure that it is installed on at least 1 peer in your network (depending on your requirements, number of peers etc). The error you get cannot get package for chaincode (:) is telling you that you have either not installed the business network onto the peer or you have tried to start a business network with the wrong name and/or version to the package you have installed on the peer(s).

When you perform composer network install you will be told the name of the business network and the version that has been installed. You can also use composer archive list to determine the business network name and version of the bna. This information is also defined in the package.json on the business network you are creating, so there are multiple ways to determine what the correct business network name and version you should use when performing the network start command.

However I if you still face this problem. So what you can do is look on the peer container itself to see what package has been installed into the peer.

  • docker exec -it /bin/bash
  • cd /var/hyperledger/production/chaincodes
  • ls

should show the installed chaincode packages and will contain a file with the name

.

if it isn't there then this is why you get the error message and the install has not completed successfully on that peer. eg

docker exec -it peer0.org1.example.com /bin/bash
root@345345435:/opt/gopath/src/github.com/hyperledger/fabric# cd /var/hyperledger/production/chaincodes
root@345345435:/var/hyperledger/production/chaincodes# ls
sample-network.0.2.4