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,090 points
2,506 views

1 answer to this question.

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
• 17,100 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,370 points
2,213 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
1,157 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
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,740 points
1,004 views
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP