Hyperledger Composer cant find business card

0 votes

I am trying to issue a new identity. I execute my Node.js application with the following code:

var businessNetwork = new BusinessNetworkConnection();
return businessNetwork.connect('admin@tutorial-network')
.then(() => {
  return businessNetwork.issueIdentity('org.acme.biznet.Trader#Trader_001', 'usr001')
})
.then((result) => {
  console.log(`userID = ${result.userID}`);
  console.log(`userSecret = ${result.userSecret}`);
})
.catch((error) => {
  console.error(error);
});

Then, UserId and UserSecret are displayed at console log. After that, I try to do a ping to Business Network:

var businessNetwork = new BusinessNetworkConnection();
return businessNetwork.connect('usr001@tutorial-network')
.then(() => {
  return businessNetwork.ping();
})
.then((result) => {
  console.log(`participant = ${result.participant ? result.participant : '<no participant found>'}`);
})
.catch((error) => {
  console.error(error);
});

I am getting this error message:

{ Error: Card not found: usr001@tutorial-network
at IdCard.fromDirectory.catch.cause (/home/user.name/git_repositories/nodejs/first.blockchain.test/node_modules/composer-common/lib/cardstore/filesystemcardstore.js:73:27)
at <anonymous>
cause: 
{ Error: Unable to read card directory: /home/user.name/.composer/cards/user001@tutorial-network

But, I am not able to find the business card. Can someone tell me how to solve this?

Oct 26, 2018 in Blockchain by digger
• 26,740 points
846 views

1 answer to this question.

0 votes

I changed the code to:

var businessNetwork = new BusinessNetworkConnection();
return businessNetwork.connect('usr001@tutorial-network')
.then(() => {
  return businessNetwork.ping();
})
.then((result) => {
  console.log(`participant = ${result.participant ? result.participant : '<no participant found>'}`);
})
.catch((error) => {
  console.error(error);
});

it works. I got the output:

linux1@fabric:~/eventclient$ node event.js
participant = org.hyperledger.composer.system.NetworkAdmin#admin
answered Oct 26, 2018 by Omkar
• 69,220 points

Related Questions In Blockchain

0 votes
1 answer

Issue deploying the business network using hyperledger composer

I had same issue. I created card ...READ MORE

answered Jun 5, 2018 in Blockchain by Johnathon
• 9,090 points
994 views
0 votes
1 answer

Hyperledger composer: runtime install error card not found peerAdmin

The right way to do it is: downloadFabric.sh startFabric.sh createPeerAdminCard.sh If ...READ MORE

answered Nov 5, 2018 in Blockchain by Omkar
• 69,220 points
1,191 views
0 votes
1 answer

Hyperledger composer: Not able to issue identities from a Business network.

To specify your own affiliation you need ...READ MORE

answered Nov 6, 2018 in Blockchain by Omkar
• 69,220 points
1,463 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,468 views
+1 vote
1 answer

I am unable to change port of composer-rest-server. Please help!

Use full format for running a business ...READ MORE

answered Mar 27, 2018 in Blockchain by Christine
• 15,790 points
1,150 views
+1 vote
1 answer
0 votes
1 answer

Cant query in Hyperledger Composer

There's a mistake in your WHERE statement. ...READ MORE

answered Oct 26, 2018 in Blockchain by Omkar
• 69,220 points
794 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP