How to decrypt result of query when using the Hyperledger Client SDK for Node.js

0 votes

In the Hyperledger Client SDK for Node.js , how can I decrypt the results of the query that are returned in the results variable below ?

tx.on('complete', function (results) {
       console.log('Results          [%j]', results);

The console.log shows a message like :

Results          ["7b22496e766f6963654944223a2269303031222c22436c69656e744944223a2269303031222c224e616d65223a224c656e6f766f2047726f7570204c74642e222c22416d6f756e74223a3130303030307d"]
Sep 18, 2018 in Blockchain by digger
• 27,620 points
17 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

In this case, it is just a hex-encoded string:

tx.on('complete', function (results) {
   console.log('Results:[%j]', new Buffer(results,'hex').toString());
}

should work

answered Sep 18, 2018 by slayer
• 29,040 points

Related Questions In Blockchain

+3 votes
2 answers

How to run ethereumjs using Node.JS

You need to install testrpc globally on ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,610 points
93 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
• 27,620 points
38 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
65 views
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.