Unable to enroll user in new org

0 votes

I am using the following link for Balance transfer from Hyperledger Fabric samples: https://github.com/hyperledger/fabric-samples/tree/master/balance-transfer#sample-rest-apis-requests

I have modified it to have 3 Orgs with 1 Peer each. Org 1 and 2 are fine, but when I try to enroll a user to my 3rd Org I get following error:

Failed to get registered user: xyz with error: Error: fabric-ca request register failed with errors [[{"code":63,"message":"Failed to get Affiliation: sql: no rows in result set"}]]
Aug 25, 2018 in Blockchain by sabby
• 4,390 points

1 answer to this question.

0 votes

The thing is by default, fabric-ca only has the following affiliations:

org1.department1 org1.department2 org2.department1

So, the fabric-ca being used in the sample does not know about the affiliation

The code which registers and enrolls users in the sample takes the org name and concatenates it with "department1":

let secret = await caClient.register({
                enrollmentID: username,
                affiliation: userOrg.toLowerCase() + '.department1'
            }, adminUserObj);

So when you pass in Org3, it tries to register the user with the affiliation org3.department1 which does not exist.

 You can look at the fabric-ca docs: http://hyperledger-fabric-ca.readthedocs.io/ 

The easiest way is to use the fabric-ca-client to do this:

fabric-ca-client affiliation add org3
fabric-ca-client affiliation add org3.department1

answered Aug 25, 2018 by Christine
• 15,790 points

Related Questions In Blockchain

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

How to control a malicious user in hyperledger fabric?

Fabric is an implementation of blockchain. Blockchain ...READ MORE

answered Jun 29, 2018 in Blockchain by Omkar
• 69,230 points
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
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
+1 vote
1 answer
+15 votes
5 answers
0 votes
1 answer

How to register a user in Hyperledger Fabric?

Best practice would be to leverage an ...READ MORE

answered Sep 5, 2018 in Blockchain by Christine
• 15,790 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP