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,080 points
259 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,020 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,170 points
1,037 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
30 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,550 points
77 views
+1 vote
1 answer