How to get the already existing channels in Hyperledger v1.0?

0 votes

I am using the Node SDK with Hyperledger 1.0 and want to check if a channel with a specific name exists. Is there a way to query all existing channels? Can I get a channel by its name?

Jun 4, 2018 in Blockchain by Johnathon
• 9,050 points
78 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

You cannot see all available channels,  but you can leverage CSCC (Configuration System Chaincode) GetChannels API to get a list of channels client eligible to. All you need to do is invoke chaincode named CSCC.

The CSCC is the system chaincode, meaning it inherently built in into peer binary and loaded and "instantiate" during peer startup. Considering NodeJS the request will look as following:

const request = {
  chaincodeId : "cscc",
  txId: 213213123123, // Some random transaction id
  fcn: "GetChannels",
  args: ['']
}

it can also be done by the peer cli

peer channel list
answered Jun 4, 2018 by Perry
• 16,450 points

Related Questions In Blockchain

+1 vote
2 answers
0 votes
1 answer

How to create channels in Hyperledger Sawtooth?

There are two features that I know ...READ MORE

answered Aug 9, 2018 in Blockchain by slayer
• 29,040 points
939 views
0 votes
1 answer

How to get the number of tokens in the Bitcoin network?

This information can easily be calculated by ...READ MORE

answered Aug 31, 2018 in Blockchain by Christine
• 15,790 points
21 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
+1 vote
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.