github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/docs/wrappers/osnadmin_channel_postscript.md (about)

     1  ## Example Usage
     2  
     3  ### osnadmin channel join examples
     4  
     5  Here's an example of the `osnadmin channel join` command.
     6  
     7  * Create and join a sample channel `mychannel` defined by the application channel genesis
     8    block contained in file `mychannel-genesis-block.pb`. Use the orderer admin endpoint
     9    at `orderer.example.com:9443`.
    10  
    11    ```
    12  
    13    osnadmin channel join -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channelID mychannel --config-block mychannel-genesis-block.pb
    14  
    15    Status: 201
    16    {
    17      "name": "mychannel",
    18      "url": "/participation/v1/channels/mychannel",
    19      "consensusRelation": "consenter",
    20      "status": "active",
    21      "height": 1
    22    }
    23  
    24    ```
    25  
    26    Status 201 and the channel details are returned indicating that the channel has been
    27    successfully created and joined.
    28  
    29  ### osnadmin channel list example
    30  
    31  Here are some examples of the `osnadmin channel list` command.
    32  
    33  * Listing all the channels that the orderer has joined. This includes the
    34    system channel (if one exists) and all of the application channels.
    35  
    36    ```
    37    osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY
    38  
    39    Status: 200
    40    {
    41      "systemChannel": null,
    42      "channels": [
    43          {
    44              "name": "mychannel",
    45              "url": "/participation/v1/channels/mychannel"
    46          }
    47      ]
    48    }
    49  
    50    ```
    51  
    52    Status 200 and the list of channels are returned.
    53  
    54  * Using the `--channelID` flag to list more details for `mychannel`.
    55  
    56    ```
    57    osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channelID mychannel
    58  
    59    Status: 200
    60    {
    61  	"name": "mychannel",
    62  	"url": "/participation/v1/channels/mychannel",
    63  	"consensusRelation": "consenter",
    64  	"status": "active",
    65  	"height": 3
    66    }
    67  
    68    ```
    69  
    70    Status 200 and the details of the channels are returned.
    71  
    72  ### osnadmin channel remove example
    73  
    74  Here's an example of the `osnadmin channel remove` command.
    75  
    76  * Removing channel `mychannel` from the orderer at `orderer.example.com:9443`.
    77  
    78    ```
    79    osnadmin channel remove -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channelID mychannel
    80  
    81    Status: 204
    82    ```
    83  
    84    Status 204 is returned upon successful removal of a channel.
    85  
    86  <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.