Hyperledger Fabric query system chaincode using node SDK

0 votes

My end goal is to get all existing channels. For that, I would have to query CSCC as suggested in this answer: https://stackoverflow.com/a/46451026/2503940

However, after creating the request, I would need a client object on which I would call the queryByChaincode method. When I try to create a channel instance using client.newChannel(''), the code throws an error saying that channel name is mandatory.

Now how do I query an SCC using node sdk without a channel instance?

Nov 9, 2018 in Blockchain by Perry
• 17,020 points
200 views

1 answer to this question.

0 votes

The Fabric Node SDK actually provides a method on the client class which will retrieve all the channels to which a peer belongs: client.queryChannels(peer, useAdmin)

answered Nov 9, 2018 by Christine
• 15,790 points

Related Questions In Blockchain

+16 votes
4 answers
+1 vote
2 answers
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,640 points
67 views
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer

What happened on deploy, invoke and query in Hyperledger chaincode?

1. Deploy: During Deploy the chaincode is written onto ...READ MORE

answered Apr 26, 2018 in Blockchain by Christine
• 15,790 points
331 views