You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 7, 2019. It is now read-only.
Hello everyone! Trying to enroll user to bluemix membership service and keep getting code:2 error. Please help!
(the certificate is there and readable, errors would have risen otherwise)
Current test code:
var hfc = require('hfc');
var fs = require('fs');
// Create a client chain.
var chain = hfc.newChain("targetChain");
// Configure the KeyValStore which is used to store sensitive keys
// as so it is important to secure this storage.
chain.setKeyValStore(hfc.newFileKeyValStore('keyValStore-5874db24'));
var cert = fs.readFileSync('certificate.pem');
// Set the URL for member services
chain.setMemberServicesUrl("grpcs://5874db24-************_ca.us.blockchain.ibm.com:30303", {
pem: cert
});
// Add a peer's URL
chain.addPeer("grpcs://5874db24-*************_vp0.us.blockchain.ibm.com:443", {pem: cert});
// Enroll "WebAppAdmin" which is already registered because it is
// listed in fabric/membersrvc/membersrvc.yaml with it's one time password.
chain.enroll("WebAppAdmin", "*****", function (err, webAppAdmin) {
if (err) return console.log("ERROR: failed to register %s: %s", err);
// Set this user as the chain's registrar which is authorized to register other users.
chain.setRegistrar(webAppAdmin);
// Begin listening for web app requests
// listenForUserRequests();
});
There are a couple things that I am seeing here as possibilities.
First of all, if you are using the Bluemix network as your backend, then you should be using the latest version of 0.5.x of hfc, as the Bluemix network is running the 0.5-developer-preview branch of Hyperledger fabric. So please switch to using hfc@0.5.3 if you will continue to run against Bluemix.
Furthermore, please make sure that the enrollment password that you are using for WebAppAdmin is the correct one, which is passed back to you from Bluemix when you deploy the network.
Lastly, regarding your specific error message: Identity or token does not match. In the vast majority of cases that indicates that your local KeyValStore and the remote membership service database are out of sync. That typically means that you have tried to enroll before, but subsequently deleted your local crypto material. Keep in mind that the enrollment process with membership services works only once. If you have successfully enrolled once and then deleted the locally stored crypto, you will not be able to enroll again. That essentially renders your network useless as the WebAppAdmin user will not able to enroll. The advice here is to tear down the existing network and deploy a new one, obtain the new credentials from Bluemix, and enroll one again.
Please give these suggestions a try and let me know if you're able to make progress.
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone! Trying to enroll user to bluemix membership service and keep getting code:2 error. Please help!
(the certificate is there and readable, errors would have risen otherwise)
Current test code:
Console output:
The text was updated successfully, but these errors were encountered: