Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Blockchain by (4.1k points)

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? And is there a way to get a channel by name?

1 Answer

0 votes
by (14.4k points)

Though you cannot view all available channels, you can anchorage the CSCC (Configuration System Chaincode) GetChannels API to get a list of those channels that clients are eligible to. All you need to do is invoke the chaincode that goes by the name CSCC.

Considering NodeJS the request will look as:

const request = {

  chaincodeId : "cscc",

  txId: 213213123123, // Some random transaction id

  fcn: "GetChannels",

  args: ['']

}

You also can also perform the same action with peer CLI:

peer channel list

Browse Categories

...