github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/docs/source/commands/osnadminchannel.md (about)

     1  <!---
     2   File generated by help_docs.sh. DO NOT EDIT.
     3   Please make changes to preamble and postscript wrappers as appropriate.
     4   --->
     5  
     6  # osnadmin channel
     7  
     8  The `osnadmin channel` command allows administrators to perform channel-related
     9  operations on an orderer, such as joining a channel, listing the channels an
    10  orderer has joined, and removing a channel. The channel participation API must
    11  be enabled and the Admin endpoint must be configured in the `orderer.yaml` for
    12  each orderer.
    13  
    14  *Note: For a network using a system channel, `list` (for all channels) and
    15  `remove` (for the system channel) are the only supported operations. Any other
    16  attempted operation will return an error.
    17  
    18  ## Syntax
    19  
    20  The `osnadmin channel` command has the following subcommands:
    21  
    22    * join
    23    * list
    24    * remove
    25  
    26  ## osnadmin channel
    27  ```
    28  usage: osnadmin channel <command> [<args> ...]
    29  
    30  Channel actions
    31  
    32  Flags:
    33        --help                     Show context-sensitive help (also try
    34                                   --help-long and --help-man).
    35    -o, --orderer-address=ORDERER-ADDRESS
    36                                   Admin endpoint of the OSN
    37        --ca-file=CA-FILE          Path to file containing PEM-encoded TLS CA
    38                                   certificate(s) for the OSN
    39        --client-cert=CLIENT-CERT  Path to file containing PEM-encoded X509 public
    40                                   key to use for mutual TLS communication with
    41                                   the OSN
    42        --client-key=CLIENT-KEY    Path to file containing PEM-encoded private key
    43                                   to use for mutual TLS communication with the
    44                                   OSN
    45        --no-status                Remove the HTTP status message from the command
    46                                   output
    47  
    48  Subcommands:
    49    channel join --channelID=CHANNELID --config-block=CONFIG-BLOCK
    50      Join an Ordering Service Node (OSN) to a channel. If the channel does not
    51      yet exist, it will be created.
    52  
    53    channel list [<flags>]
    54      List channel information for an Ordering Service Node (OSN). If the
    55      channelID flag is set, more detailed information will be provided for that
    56      channel.
    57  
    58    channel remove --channelID=CHANNELID
    59      Remove an Ordering Service Node (OSN) from a channel.
    60  ```
    61  
    62  
    63  ## osnadmin channel join
    64  ```
    65  usage: osnadmin channel join --channelID=CHANNELID --config-block=CONFIG-BLOCK
    66  
    67  Join an Ordering Service Node (OSN) to a channel. If the channel does not yet
    68  exist, it will be created.
    69  
    70  Flags:
    71        --help                     Show context-sensitive help (also try
    72                                   --help-long and --help-man).
    73    -o, --orderer-address=ORDERER-ADDRESS
    74                                   Admin endpoint of the OSN
    75        --ca-file=CA-FILE          Path to file containing PEM-encoded TLS CA
    76                                   certificate(s) for the OSN
    77        --client-cert=CLIENT-CERT  Path to file containing PEM-encoded X509 public
    78                                   key to use for mutual TLS communication with
    79                                   the OSN
    80        --client-key=CLIENT-KEY    Path to file containing PEM-encoded private key
    81                                   to use for mutual TLS communication with the
    82                                   OSN
    83        --no-status                Remove the HTTP status message from the command
    84                                   output
    85    -c, --channelID=CHANNELID      Channel ID
    86    -b, --config-block=CONFIG-BLOCK
    87                                   Path to the file containing an up-to-date
    88                                   config block for the channel
    89  ```
    90  
    91  
    92  ## osnadmin channel list
    93  ```
    94  usage: osnadmin channel list [<flags>]
    95  
    96  List channel information for an Ordering Service Node (OSN). If the channelID
    97  flag is set, more detailed information will be provided for that channel.
    98  
    99  Flags:
   100        --help                     Show context-sensitive help (also try
   101                                   --help-long and --help-man).
   102    -o, --orderer-address=ORDERER-ADDRESS
   103                                   Admin endpoint of the OSN
   104        --ca-file=CA-FILE          Path to file containing PEM-encoded TLS CA
   105                                   certificate(s) for the OSN
   106        --client-cert=CLIENT-CERT  Path to file containing PEM-encoded X509 public
   107                                   key to use for mutual TLS communication with
   108                                   the OSN
   109        --client-key=CLIENT-KEY    Path to file containing PEM-encoded private key
   110                                   to use for mutual TLS communication with the
   111                                   OSN
   112        --no-status                Remove the HTTP status message from the command
   113                                   output
   114    -c, --channelID=CHANNELID      Channel ID
   115  ```
   116  
   117  
   118  ## osnadmin channel remove
   119  ```
   120  usage: osnadmin channel remove --channelID=CHANNELID
   121  
   122  Remove an Ordering Service Node (OSN) from a channel.
   123  
   124  Flags:
   125        --help                     Show context-sensitive help (also try
   126                                   --help-long and --help-man).
   127    -o, --orderer-address=ORDERER-ADDRESS
   128                                   Admin endpoint of the OSN
   129        --ca-file=CA-FILE          Path to file containing PEM-encoded TLS CA
   130                                   certificate(s) for the OSN
   131        --client-cert=CLIENT-CERT  Path to file containing PEM-encoded X509 public
   132                                   key to use for mutual TLS communication with
   133                                   the OSN
   134        --client-key=CLIENT-KEY    Path to file containing PEM-encoded private key
   135                                   to use for mutual TLS communication with the
   136                                   OSN
   137        --no-status                Remove the HTTP status message from the command
   138                                   output
   139    -c, --channelID=CHANNELID      Channel ID
   140  ```
   141  
   142  ## Example Usage
   143  
   144  ### osnadmin channel join examples
   145  
   146  Here's an example of the `osnadmin channel join` command.
   147  
   148  * Create and join a sample channel `mychannel` defined by the application channel genesis
   149    block contained in file `mychannel-genesis-block.pb`. Use the orderer admin endpoint
   150    at `orderer.example.com:9443`.
   151  
   152    ```
   153  
   154    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
   155  
   156    Status: 201
   157    {
   158      "name": "mychannel",
   159      "url": "/participation/v1/channels/mychannel",
   160      "consensusRelation": "consenter",
   161      "status": "active",
   162      "height": 1
   163    }
   164  
   165    ```
   166  
   167    Status 201 and the channel details are returned indicating that the channel has been
   168    successfully created and joined.
   169  
   170  ### osnadmin channel list example
   171  
   172  Here are some examples of the `osnadmin channel list` command.
   173  
   174  * Listing all the channels that the orderer has joined. This includes the
   175    system channel (if one exists) and all of the application channels.
   176  
   177    ```
   178    osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY
   179  
   180    Status: 200
   181    {
   182      "systemChannel": null,
   183      "channels": [
   184          {
   185              "name": "mychannel",
   186              "url": "/participation/v1/channels/mychannel"
   187          }
   188      ]
   189    }
   190  
   191    ```
   192  
   193    Status 200 and the list of channels are returned.
   194  
   195  * Using the `--channelID` flag to list more details for `mychannel`.
   196  
   197    ```
   198    osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channelID mychannel
   199  
   200    Status: 200
   201    {
   202  	"name": "mychannel",
   203  	"url": "/participation/v1/channels/mychannel",
   204  	"consensusRelation": "consenter",
   205  	"status": "active",
   206  	"height": 3
   207    }
   208  
   209    ```
   210  
   211    Status 200 and the details of the channels are returned.
   212  
   213  ### osnadmin channel remove example
   214  
   215  Here's an example of the `osnadmin channel remove` command.
   216  
   217  * Removing channel `mychannel` from the orderer at `orderer.example.com:9443`.
   218  
   219    ```
   220    osnadmin channel remove -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channelID mychannel
   221  
   222    Status: 204
   223    ```
   224  
   225    Status 204 is returned upon successful removal of a channel.
   226  
   227  <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>.