-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osnadmin CLI command reference #2077
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
# osnadmin channel | ||
|
||
The `osnadmin channel` command allows administrators to perform channel-related | ||
operations on an orderer, such as joining a channel, listing the channels an | ||
orderer has joined, and removing a channel. The channel participation API must | ||
be enabled and the Admin endpoint must be configured in the `orderer.yaml` for | ||
each orderer. | ||
|
||
*Note: For a network using a system channel, `list` (for all channels) and | ||
`remove` (for the system channel) are the only supported operations. Any other | ||
attempted operation will return an error. | ||
|
||
## Syntax | ||
|
||
The `osnadmin channel` command has the following subcommands: | ||
|
||
* join | ||
* list | ||
* remove | ||
|
||
## osnadmin channel | ||
``` | ||
usage: osnadmin channel <command> [<args> ...] | ||
|
||
Channel actions | ||
|
||
Flags: | ||
--help Show context-sensitive help (also try | ||
--help-long and --help-man). | ||
-o, --orderer-address=ORDERER-ADDRESS | ||
Admin endpoint of the OSN | ||
--ca-file=CA-FILE Path to file containing PEM-encoded TLS CA | ||
certificate(s) for the OSN | ||
--client-cert=CLIENT-CERT Path to file containing PEM-encoded X509 public | ||
key to use for mutual TLS communication with | ||
the OSN | ||
--client-key=CLIENT-KEY Path to file containing PEM-encoded private key | ||
to use for mutual TLS communication with the | ||
OSN | ||
|
||
Subcommands: | ||
channel join --channel-id=CHANNEL-ID --config-block=CONFIG-BLOCK | ||
Join an Ordering Service Node (OSN) to a channel. If the channel does not | ||
yet exist, it will be created. | ||
|
||
channel list [<flags>] | ||
List channel information for an Ordering Service Node (OSN). If the | ||
channel-id flag is set, more detailed information will be provided for that | ||
channel. | ||
|
||
channel remove --channel-id=CHANNEL-ID | ||
Remove an Ordering Service Node (OSN) from a channel. | ||
``` | ||
|
||
|
||
## osnadmin channel join | ||
``` | ||
usage: osnadmin channel join --channel-id=CHANNEL-ID --config-block=CONFIG-BLOCK | ||
|
||
Join an Ordering Service Node (OSN) to a channel. If the channel does not yet | ||
exist, it will be created. | ||
|
||
Flags: | ||
--help Show context-sensitive help (also try | ||
--help-long and --help-man). | ||
-o, --orderer-address=ORDERER-ADDRESS | ||
Admin endpoint of the OSN | ||
--ca-file=CA-FILE Path to file containing PEM-encoded TLS CA | ||
certificate(s) for the OSN | ||
--client-cert=CLIENT-CERT Path to file containing PEM-encoded X509 public | ||
key to use for mutual TLS communication with | ||
the OSN | ||
--client-key=CLIENT-KEY Path to file containing PEM-encoded private key | ||
to use for mutual TLS communication with the | ||
OSN | ||
-c, --channel-id=CHANNEL-ID Channel ID | ||
-b, --config-block=CONFIG-BLOCK | ||
Path to the file containing an up-to-date | ||
config block for the channel | ||
``` | ||
|
||
|
||
## osnadmin channel list | ||
``` | ||
usage: osnadmin channel list [<flags>] | ||
|
||
List channel information for an Ordering Service Node (OSN). If the channel-id | ||
flag is set, more detailed information will be provided for that channel. | ||
|
||
Flags: | ||
--help Show context-sensitive help (also try | ||
--help-long and --help-man). | ||
-o, --orderer-address=ORDERER-ADDRESS | ||
Admin endpoint of the OSN | ||
--ca-file=CA-FILE Path to file containing PEM-encoded TLS CA | ||
certificate(s) for the OSN | ||
--client-cert=CLIENT-CERT Path to file containing PEM-encoded X509 public | ||
key to use for mutual TLS communication with | ||
the OSN | ||
--client-key=CLIENT-KEY Path to file containing PEM-encoded private key | ||
to use for mutual TLS communication with the | ||
OSN | ||
-c, --channel-id=CHANNEL-ID Channel ID | ||
``` | ||
|
||
|
||
## osnadmin channel remove | ||
``` | ||
usage: osnadmin channel remove --channel-id=CHANNEL-ID | ||
|
||
Remove an Ordering Service Node (OSN) from a channel. | ||
|
||
Flags: | ||
--help Show context-sensitive help (also try | ||
--help-long and --help-man). | ||
-o, --orderer-address=ORDERER-ADDRESS | ||
Admin endpoint of the OSN | ||
--ca-file=CA-FILE Path to file containing PEM-encoded TLS CA | ||
certificate(s) for the OSN | ||
--client-cert=CLIENT-CERT Path to file containing PEM-encoded X509 public | ||
key to use for mutual TLS communication with | ||
the OSN | ||
--client-key=CLIENT-KEY Path to file containing PEM-encoded private key | ||
to use for mutual TLS communication with the | ||
OSN | ||
-c, --channel-id=CHANNEL-ID Channel ID | ||
``` | ||
|
||
## Example Usage | ||
|
||
### osnadmin channel join examples | ||
|
||
Here's an example of the `osnadmin channel join` command. | ||
|
||
* Create and join a sample channel `mychannel` defined by the application channel genesis | ||
block contained in file `mychannel-genesis-block.pb`. Use the orderer admin endpoint | ||
at `orderer.example.com:9443`. | ||
|
||
``` | ||
|
||
osnadmin channel join -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channel-id mychannel --config-block mychannel-genesis-block.pb | ||
|
||
Status: 201 | ||
{ | ||
"name": "mychannel", | ||
"url": "/participation/v1/channels/mychannel", | ||
"consensusRelation": "consenter", | ||
"status": "active", | ||
"height": 1 | ||
} | ||
|
||
``` | ||
|
||
Status 201 and the channel details are returned indicating that the channel has been | ||
successfully created and joined. | ||
|
||
### osnadmin channel list example | ||
|
||
Here are some examples of the `osnadmin channel list` command. | ||
|
||
* Listing all the channels that the orderer has joined. This includes the | ||
system channel (if one exists) and all of the application channels. | ||
|
||
``` | ||
osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY | ||
|
||
Status: 200 | ||
{ | ||
"systemChannel": null, | ||
"channels": [ | ||
{ | ||
"name": "mychannel", | ||
"url": "/participation/v1/channels/mychannel" | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
Status 200 and the list of channels are returned. | ||
|
||
* Using the `--channel-id` flag to list more details for `mychannel`. | ||
|
||
``` | ||
osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channel-id mychannel | ||
|
||
Status: 200 | ||
{ | ||
"name": "mychannel", | ||
"url": "/participation/v1/channels/mychannel", | ||
"consensusRelation": "consenter", | ||
"status": "active", | ||
"height": 3 | ||
} | ||
|
||
``` | ||
|
||
Status 200 and the details of the channels are returned. | ||
|
||
### osnadmin channel remove example | ||
|
||
Here's an example of the `osnadmin channel remove` command. | ||
|
||
* Removing channel `mychannel` from the orderer at `orderer.example.com:9443`. | ||
|
||
``` | ||
osnadmin channel remove -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channel-id mychannel | ||
|
||
Status: 204 | ||
``` | ||
|
||
Status 204 is returned upon successful removal of a channel. | ||
|
||
<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>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
## Example Usage | ||
|
||
### osnadmin channel join examples | ||
|
||
Here's an example of the `osnadmin channel join` command. | ||
|
||
* Create and join a sample channel `mychannel` defined by the application channel genesis | ||
block contained in file `mychannel-genesis-block.pb`. Use the orderer admin endpoint | ||
at `orderer.example.com:9443`. | ||
|
||
``` | ||
|
||
osnadmin channel join -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channel-id mychannel --config-block mychannel-genesis-block.pb | ||
|
||
Status: 201 | ||
{ | ||
"name": "mychannel", | ||
"url": "/participation/v1/channels/mychannel", | ||
"consensusRelation": "consenter", | ||
"status": "active", | ||
"height": 1 | ||
} | ||
|
||
``` | ||
|
||
Status 201 and the channel details are returned indicating that the channel has been | ||
successfully created and joined. | ||
|
||
### osnadmin channel list example | ||
|
||
Here are some examples of the `osnadmin channel list` command. | ||
|
||
* Listing all the channels that the orderer has joined. This includes the | ||
system channel (if one exists) and all of the application channels. | ||
|
||
``` | ||
osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY | ||
|
||
Status: 200 | ||
{ | ||
"systemChannel": null, | ||
"channels": [ | ||
{ | ||
"name": "mychannel", | ||
"url": "/participation/v1/channels/mychannel" | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
Status 200 and the list of channels are returned. | ||
|
||
* Using the `--channel-id` flag to list more details for `mychannel`. | ||
|
||
``` | ||
osnadmin channel list -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channel-id mychannel | ||
|
||
Status: 200 | ||
{ | ||
"name": "mychannel", | ||
"url": "/participation/v1/channels/mychannel", | ||
"consensusRelation": "consenter", | ||
"status": "active", | ||
"height": 3 | ||
} | ||
|
||
``` | ||
|
||
Status 200 and the details of the channels are returned. | ||
|
||
### osnadmin channel remove example | ||
|
||
Here's an example of the `osnadmin channel remove` command. | ||
|
||
* Removing channel `mychannel` from the orderer at `orderer.example.com:9443`. | ||
|
||
``` | ||
osnadmin channel remove -o orderer.example.com:9443 --ca-file $CA_FILE --client-cert $CLIENT_CERT --client-key $CLIENT_KEY --channel-id mychannel | ||
|
||
Status: 204 | ||
``` | ||
|
||
Status 204 is returned upon successful removal of a channel. | ||
|
||
<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>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# osnadmin channel | ||
|
||
The `osnadmin channel` command allows administrators to perform channel-related | ||
operations on an orderer, such as joining a channel, listing the channels an | ||
orderer has joined, and removing a channel. The channel participation API must | ||
be enabled and the Admin endpoint must be configured in the `orderer.yaml` for | ||
each orderer. | ||
|
||
*Note: For a network using a system channel, `list` (for all channels) and | ||
`remove` (for the system channel) are the only supported operations. Any other | ||
attempted operation will return an error. | ||
|
||
## Syntax | ||
|
||
The `osnadmin channel` command has the following subcommands: | ||
|
||
* join | ||
* list | ||
* remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do they know that these 2 fields are required and not optional throughout these commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flags are all set as required in the implementation (the only optional flag for any the commands is --channel-id on the list command). The CLI will return an error if any required flags are not set. Do we do anything to differentiate the required flags for other commands that you're aware of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK makes sense. Then I would suggest we update the list command so they know that --channel-id is optional -- if not specified they will get back the details of all the channels the osn is a member of instead of a specific one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have that included in the description for list: "If the channel-id flag is set, more detailed information will be provided for that channel." and also mention it in the example usage for the command.
Do you have specific places you'd like to see more added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the --ca-file flag, how would they know this is the root cert of the TLS CA and not the organization CA?
Should it be:
Path to file containing PEM-encoded trusted TLS certificate(s) for the OSN
or more specifically:
Path to file containing PEM-encoded trusted root certificate(s) of the TLS CA for the OSN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reused the flag description that we've been using for years on the
peer channel
flag of the same name. I can certainly update this if we think it's beneficial.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to
Path to file containing PEM-encoded TLS CA certificate(s) for the OSN