9

I'm working on a proof of concept for blockchain. I've am using bluemix network for blockchain and deploying my application, which I develop locally. I want to test the CA functionalities and want to add users with attributes to the membersrvs.yaml , and perform Attribute Based Access control. However, I'm not able to find out how can I edit/update the file while my network is hosted on bluemix. Pardon me if this seems very basic, I'm still getting a hang on things.

ralphearle
  • 1,696
  • 13
  • 18
tortuga
  • 737
  • 2
  • 13
  • 34
  • I've been trying all day just to make an account on BlueMix, it seems to be broken- is it so? – smatthewenglish Jul 19 '16 at 15:19
  • 1
    yes, It has been since last week. They had a big release at the start on this month. – tortuga Jul 19 '16 at 15:34
  • Is it just this one file you cannot edit, or are there a bunch of files you cannot edit? Or is it that when you edit the file, the changes don't actually take effect on the chain? – Davis Broda Jul 19 '16 at 16:55
  • 1
    Since the VP and CA server are hosted in bluemix environment, I don't have any access the membersrvc.yaml or core.yaml files. So, my question is how to modify these files – tortuga Jul 19 '16 at 17:56
  • Bluemix was experiencing issues with new account creation and login earlier this week, but they have been resolved. You can check status for Bluemix platform and services at https://developer.ibm.com/bluemix/support/#status. If you are still having problems creating an account, please open a Bluemix support ticket at https://support.ng.bluemix.net/technicalsupport/. – ralphearle Jul 22 '16 at 16:57
  • Does anybody has been able to solve this? @ralphearle – arodriguezdonaire Mar 31 '17 at 07:17

1 Answers1

2

You cannot edit/customize membersrvs.yaml that resides in the Bluemix Blockchain Service.

However, you can still add users via an API. This is not exposed via the REST interface, you will have to use gRPC (via the HFC SDK). There is an example in the demo "cp-web" line 76 (also below)

/**
 * Registers a new user in the membership service for the blockchain network.
 * @param enrollID The name of the user we want to register.
 * @param cb A callback of the form: function(error, user_credentials)
 */
module.exports.registerUser = function (enrollID, cb) {
    console.log(TAG, 'registerUser() called');

    if (!chain) {
        cb(new Error('Cannot register a user before setup() is called.'));
        return;
    }

    chain.getMember(enrollID, function (err, usr) {
        if (!usr.isRegistered()) {
            console.log(TAG, 'Sending registration request for:', enrollID);
            var registrationRequest = {
                enrollmentID: enrollID,
                affiliation: 'group1'
            };
            usr.register(registrationRequest, function (err, enrollSecret) {
                if (err) {
                    cb(err);
                } else {
                    var cred = {
                        id: enrollID,
                        secret: enrollSecret
                    };
                    console.log(TAG, 'Registration request completed >successfully!');
                    cb(null, cred);
                }
           });
        } else {
            cb(new Error('Cannot register an existing user'));
        }
    });
};
unknown
  • 81
  • 4