Closed alachaitanya closed 7 years ago
https://developer.ibm.com/answers/questions/299158/how-to-add-users.html Please checkout this link on dwAnswers.
Pasting answer from @altharp here for convenience:
There are a couple of examples that show how to create a new user. To summarize, a user first needs to be designated as the registrar for the Blockchain network. Then this user will be authorized to add other users.
The Hyperledger Fabric Client example is one such example that adds a new user. Refer to the documentation for the example at https://console.ng.bluemix.net/docs/services/blockchain/etn_sdk.html. The helloblockchain.js file which is part of the example has an enrollAndRegisterUsers function. This shows the "admin" user being set as the registrar for the Blockchain network. Then a new user is created based on user name information included in the config.json file (which is in the same location as helloblockchain.js). In the case of the example, the new user is "JohnDoe" and the affiliation is set as "group1".
There is also a Hyperledger test case that can be used as an example: https://github.com/hyperledger/fabric/blob/ceefb12425b7ccb09fc0f88dc78d395a459dca55/sdk/node/test/unit/registrar.js. The registrarTest function enrolls the "admin" user and calls the chain.setRegistrar function to set the "admin" user as the registrar for the Blockchain network. Then the registrarTestStep3 function registers and enrolls "webUser" which is not a user initially included in the service credentials for a Blockchain network.
closed due to inactivity
Hi,
I'm trying to deploy chaincode of your example 'Car Lease Demo' on my blockchain network. However, I'm not able to understand how to get an ecerts with defined roles such as 'regulator' so I can add vehicles etc. Please help me with this.