3

I was following this tutorial fine until I got an error

Error: Card not found: PeerAdmin@hlfv1

at below command :

 composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network

The tutorial says that usually a peerAdmin identity has to be made but that they have already made one.

MAhipal Singh
  • 4,745
  • 1
  • 42
  • 57
theroguecode
  • 191
  • 2
  • 6

4 Answers4

7

For this tutorial you will have already followed the instructions to set up your development environment. There are some scripts to start the Fabric:

downloadFabric.sh
startFabric.sh
createPeerAdminCard.sh

If you run that last script it should solve your problem.

You can run composer card list to verify that you have the PeerAdmin card.

After further testing ...

I would say that either there is an existing card that can't be deleted for some reason, or else you do not have access to create the folder ~/.composer.

I would suggest using this command to check if the folder exists ls ~/.composer and if it does, then rm -rf ~/.composer to remove it and all its contents. Now create a new empty folder mkdir ~/.composer and rerun the script to create the Peer Admin card createPeerAdminCard.sh from the fabric-tools folder.

R Thatcher
  • 5,550
  • 1
  • 7
  • 15
  • I followed the steps and the PeerAdmin@h1fv1.card was generated in the folder /tmp/ but it still gives me Error: Card not found: PeerAdmin@h1fv1 when I run composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network – theroguecode Feb 21 '18 at 11:41
  • What version of Composer are you running? ( composer -v ) If you are using v0.17.x then be sure to "export FABRIC_VERSION=hlfv11" before running these start and createPeerAdmin scripts. – R Thatcher Feb 21 '18 at 11:53
  • I'm running v0.16.4. Should I run stopFabric.sh then do the export command? – theroguecode Feb 21 '18 at 12:03
  • no - only if you are on v0.17.* - if you are using v0.16.4 the environment variable should NOT be set (you could use echo $FABRIC_VERSION to check it isn't.) – R Thatcher Feb 21 '18 at 12:24
1

Please use following two steps:

$composer network install -a test-bank@0.0.1.bna -c PeerAdmin@hlfv1
$composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --file networkadmin.card --networkName test-bank --networkVersion 0.0.1
Colwin
  • 2,655
  • 3
  • 25
  • 25
0

please try to use sudo as a prefix. below is the sample

  • sudo ./createPeerAdminCard.sh
  • sudo composer card list --card PeerAdmin@hlfv1
  • "sudo composer network deploy -a ../../Downloads/my-basic-sample.bna -A admin -S adminpw -c PeerAdmin@hlfv1 -f networkadmin.card".

I was facing the same issue and using sudo as a prefix fixed it.

syny
  • 68
  • 1
  • 4
metadata
  • 1,139
  • 1
  • 7
  • 28
0

i know that my answer is a bit late, but since i came across the same issue, here is what i did to solve it:

  1. execute: composer card list to see what cards are already available.
  2. If PeerAdmin card already exists, i would recommend you execute ~/fabric-tools/stopFabric.sh followed by ~/fabric-tools/teardownFabric.sh just make sure that you have removed all instances of the old PeerAdmin card
  3. execute: ~/fabric-tools./createPeerAdminCard.sh to create a brand new PeerAdmin card. execute step 1 to see if the card was created successfully
  4. execute ~/fabric-tools./startFabric.sh to start the Hyperledger Fabric services
  5. now try to execute the above command and the issue should be fixed.
vivek86
  • 707
  • 9
  • 18