-
Notifications
You must be signed in to change notification settings - Fork 350
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
Add flag to enable interactive prompt in create channel
CLI
#2014
Add flag to enable interactive prompt in create channel
CLI
#2014
Conversation
…nto create-channel-cli
There's an open issue in the |
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.
Neat work! Left some suggestions below.
It seems that the 'usage' message is not very clear:
$ ./target/debug/hermes create channel
error: The following required arguments were not provided:
--port-a <PORT_A>
--port-b <PORT_B>
<CHAIN_A_ID>
USAGE:
hermes create channel [OPTIONS] --port-a <PORT_A> --port-b <PORT_B> <CHAIN_A_ID> [CHAIN_B_ID]
I think we should make it so that the 'usage' output here presents the user with the default invocation, which has a connection ID (and has no chain-b-ID). I suspect to do that we need to:
- make the
chain_b_id
option to be non-positional, i.e., it should have theclap
pragma config includingshort, long
-make the connection_a
option to be positional (remove the clap
pragmas config short, long
.
I would also suggest we rename top-level message that create channel --help
provides. It is currently:
Create a new channel between two chains
maybe would be more accurate to have
Create a new channel using an existing connection, or alternatively using a new client and connection.
@mzabaluev when you get a chance have a look over & review this please. |
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 changes look good, though I'm still uncomfortable with bringing interactivity into the otherwise script-friendly CLI command. What's the failure mode when the input is /dev/null
?
Should the guide be updated now that create channel
does not automatically create a connection and clients by omission?
Yes, I'll update the guide 👍 |
Can we update this PR with a more descriptive title? |
create channel
CLI
create channel
CLIcreate channel
CLI
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.
Renaming looks good, just needs to be completed everywhere and the guide updated accordingly.-
The guide has been updated accordingly. @romac are there any other changes you think need to be made before we merge this? |
Ah my bad, sorry about that. Can you please split out the guide changes into a separate PR so that we can merge it once we release v0.14? Otherwise the guide will be updated before we actually release v0.14, which may confuse users. |
Perfect 👍 |
Closes: #1421
Description
Changes the flow of the
create channel
CLI command. The default invocation has been changed fromto
If users want to create new clients and connections using this invocation, it is now required that
--new-client-connections
flag be passed along:This brings up an interactive prompt that the user must agree to, letting them know that they are creating new clients / connections as part of the invocation.
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.