1
votes

I've deployed the hyperledger-fabric service on Bluemix and obtained the credentials from there, one line looks like this:

   {"enrollId":"user_type1_0","enrollSecret":"XXXXX","group":"group1","affiliation":"0001","username":"user_type1_0","secret":"XXXXX"}

I post the following to the "registrar" REST endpoint:

Secret: { "enrollId": "user_type1_0", "enrollSecret": "xxxxx" }

I get this response:

{ "OK": "Login successful for user 'user_type1_0'." }

Then I try to register some chaincode using POSTing the following to the chaincode REST endpoint:

QuerySpec { "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID": { "path": "https://github.com/ibm-blockchain/learn-chaincode/finished" }, "ctorMsg": { "function": "init", "args": [ "hi there" ] }, "secureContext": "user_type1_0_xxxxx" }, "id": 1 }

I get this reponse:

{ "jsonrpc": "2.0", "error": { "code": -32000, "message": "Registration missing", "data": "User not logged in. Use the '/registrar' endpoint to obtain a security token." }, "id": 1 }

Any idea?

1

1 Answers

2
votes

Fabric expects that you will provide EnrolmentID as a security context but you are trying to use "ID+Pass".

Can you try to run your deploy command with another SecurityContext value ?

QuerySpec { "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID": { "path": "https://github.com/ibm-blockchain/learn-chaincode/finished" }, "ctorMsg": { "function": "init", "args": [ "hi there" ] }, "secureContext": "user_type1_0" }, "id": 1 }