Not able to POST chaincode to hyperledger-fabric using API

0 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 how to solve this?

Oct 30, 2018 in Blockchain by slayer
• 29,310 points

retagged Nov 22, 2018 by Priyaj 314 views

2 answers to this question.

0 votes
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 }
answered Oct 30, 2018 by Omkar
• 69,210 points
0 votes
TypeError: Cannot read property 'curve' of undefined
    at Object.KEYUTIL.getKey (/home/quolam-002/Documents/Hyperledger_Fabric proejct/fabric-samples/vytalconnect2/node_modules/fabric-client/node_modules/jsrsasign/lib/jsrsasign.js:247:10379)
    at CryptoSuite_ECDSA_AES.getKey (/home/quolam-002/Documents/Hyperledger_Fabric proejct/fabric-samples/vytalconnect2/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:206:27)
answered Jan 30, 2019 by SHRADDHA

Related Questions In Blockchain

0 votes
1 answer

Not Able to register a user with Hyperledger-Fabric v1.1 preview

The error: "Certificate not found with AKI 'e729224e8b3f31784c8a93c5b8ef6f4c1c91d9e6e577c45c33163609fe40011' ...READ MORE

answered Jun 16, 2018 in Blockchain by charlie_brown
• 7,710 points
1,133 views
0 votes
1 answer

Not able to send payments using Blockchain API.

Try the following code. It should help ...READ MORE

answered Jul 31, 2018 in Blockchain by slayer
• 29,310 points
241 views
0 votes
1 answer

Not able to run chaincode locally using docker

Looks like the Fabric team introduced "nopkcs11" ...READ MORE

answered Sep 18, 2018 in Blockchain by slayer
• 29,310 points
208 views
0 votes
1 answer

Hyperledger fabric: curl not working to invoke chaincode

Hyperledger Fabric does not offer a REST ...READ MORE

answered Oct 23, 2018 in Blockchain by Perry
• 17,100 points
710 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
• 26,720 points
429 views
+1 vote
1 answer

How do i change the names of validating peers in IBM Bluemix blockchain?

IBM Bluemix Blockchain service Hyperledger Fabric v0.6 will ...READ MORE

answered Apr 11, 2018 in Blockchain by Perry
452 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP