Skip to content
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

cmd/puppeth: use geth's prompt to read input #23718

Merged
merged 6 commits into from
Oct 18, 2021

Conversation

jwasinger
Copy link
Contributor

fixes #23717

@jwasinger
Copy link
Contributor Author

Unsure if it's possible now, but I meant to mark this as a draft.

@jwasinger
Copy link
Contributor Author

Alright, ready for review now.

@holiman
Copy link
Contributor

holiman commented Oct 13, 2021

Without this PR:

[user@work bin]$ ./puppeth 
+-----------------------------------------------------------+
| Welcome to puppeth, your Ethereum private network manager |
|                                                           |
| This tool lets you create a new Ethereum network down to  |
| the genesis block, bootnodes, miners and ethstats servers |
| without the hassle that it would normally entail.         |
|                                                           |
| Puppeth uses SSH to dial in to remote servers, and builds |
| its network components out of Docker containers using the |
| docker-compose toolset.                                   |
+-----------------------------------------------------------+

Please specify a network name to administer (no spaces, hyphens or capital letters please)
> foobar^[[D^[[C^[[D^C

I typed foobar then tried to go left/right, and then ctrl-c to exit.

With this PR:

[user@work bin]$ ../../cmd/puppeth/puppeth 
+-----------------------------------------------------------+
| Welcome to puppeth, your Ethereum private network manager |
|                                                           |
| This tool lets you create a new Ethereum network down to  |
| the genesis block, bootnodes, miners and ethstats servers |
| without the hassle that it would normally entail.         |
|                                                           |
| Puppeth uses SSH to dial in to remote servers, and builds |
| its network components out of Docker containers using the |
| docker-compose toolset.                                   |
+-----------------------------------------------------------+

Please specify a network name to administer (no spaces, hyphens or capital letters please)
> foo^C
CRIT [10-13|09:37:08.545] Failed to read user input                err="prompt aborted"

The left-right worked well, but then ctrl-c caused a CRIT error, which might not be what we want (?)

@jwasinger
Copy link
Contributor Author

Ooh yes. Good catch.

@jwasinger
Copy link
Contributor Author

Alright. Should be good to go now.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman merged commit 60d3cc8 into ethereum:master Oct 18, 2021
@holiman holiman added this to the 1.10.11 milestone Oct 18, 2021
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Oct 20, 2021
* cmd/puppeth: use geth's prompt to read input

* remove wizard.in

* cmd/puppeth: fix compilation errors

* reset prompt (don't exit) on receiving ctrl-c

* make promptInput spin until the user enters a value or interrupts (ctrl-d)

* make promptInput use parameter

Co-authored-by: Martin Holst Swende <[email protected]>
@jwasinger jwasinger deleted the puppeth-prompt branch October 21, 2021 20:41
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
* cmd/puppeth: use geth's prompt to read input

* remove wizard.in

* cmd/puppeth: fix compilation errors

* reset prompt (don't exit) on receiving ctrl-c

* make promptInput spin until the user enters a value or interrupts (ctrl-d)

* make promptInput use parameter

Co-authored-by: Martin Holst Swende <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

puppeth: input prompt doesn't handle arrow keys correctly
2 participants