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 24, 2018 in Blockchain by sabby
• 4,050 points
354 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 24, 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
• 66,910 points
140 views
0 votes
1 answer
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
• 27,620 points
52 views
+1 vote
1 answer
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
304 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.