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

goal: added "wallet new -n" non-interactive wallet creation #6160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tasosbit
Copy link

Adds this option to goal wallet new:

-n, --non-interactive
Create the new wallet without prompting for password or displaying the seed phrase

Skipping the password prompt is useful in scripted KMD creation.

The password prompt method for goal wallet new, which hides the input from the console, doesn't work with piping (unlike goal account import, which accepts echo apple apple apple ... | goal account import)

@tasosbit tasosbit mentioned this pull request Oct 31, 2024
@jannotti
Copy link
Contributor

jannotti commented Oct 31, 2024

I don't quite understand what this is doing, so I assume users will be in the same boat. Does it create a account that can be used without a password? Or with the empty password? Is there a distinction between those two things? Or perhaps it creates an account that kmd can't use, and the seed phrase must be used to recover it?

(a few minutes pass)

Having read some kmd source code, I think it makes an unencrypted wallet. I think the argument and the help text should be directed at telling the user that, rather than simply saying "skip password". Something like --unencrypted (and I would simply not have a short option, to make this less tempting for users who don't really want it.)

@@ -134,7 +142,7 @@ var newWalletCmd = &cobra.Command{
}
reportInfof(infoCreatedWallet, walletName)

if !recoverWallet {
if !recoverWallet && !noPassword {
Copy link
Contributor

Choose a reason for hiding this comment

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

I might make --no-seed a separate option, assuming you agree with my thought that this should be called --unencrypted instead of --non-interactive. I get that you're thinking of the single use case of non-interactive, which ought to imply "no-seed". But if we treat "unencrypted" as the use case, it is separable from "non-interactive".

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 56.28%. Comparing base (eff5fb4) to head (3be4782).

Files with missing lines Patch % Lines
cmd/goal/wallet.go 8.33% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6160      +/-   ##
==========================================
+ Coverage   55.99%   56.28%   +0.29%     
==========================================
  Files         494      494              
  Lines       69958    69963       +5     
==========================================
+ Hits        39174    39380     +206     
+ Misses      28077    27910     -167     
+ Partials     2707     2673      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tasosbit
Copy link
Author

tasosbit commented Nov 4, 2024

Having read some kmd source code, I think it makes an unencrypted wallet. I think the argument and the help text should be directed at telling the user that, rather than simply saying "skip password". Something like --unencrypted (and I would simply not have a short option, to make this less tempting for users who don't really want it.)

Correct, the idea is to create a wallet without prompting for password. I agree that unencrypted is a much better/clearer label than non-interactive. I will change this.

Will also split the unencrypted feature from the no-display-seed one

Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Agree with JJ - use --unencrypted for suppressing the password prompt only. This should not affect the mnemonic output since a master key used for account key generation and orthogonal to wallet passwords.

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.

3 participants