-
Notifications
You must be signed in to change notification settings - Fork 912
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
hsmtool.c - Added new method to enable creation of hsm_file from cmd-line args #7102
Conversation
Sorry about the delay reviewing! I prefer to extend generatehsm to take the cmdline args if they are present? That ensures that the language list stays consistent, for example. |
@bstin any update on this? |
For compatibility with another mobile wallet where people can import this list of words, I would like to have just English as an option, using different languages can cause lack with other wallets |
962b607
to
669963f
Compare
I rewrote this to extend the generatehsm command line instead. |
d3c106f
to
40e2f1e
Compare
l1.stop() | ||
|
||
# We can do the entire thing non-interactive! | ||
os.remove(hsm_path) | ||
subprocess.check_output(["tools/hsmtool", | ||
"generatehsm", hsm_path, | ||
"en", | ||
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"]) | ||
assert open(hsm_path, "rb").read().hex() == "5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc1" |
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 was more happy to have a separate test, but anyway 😄
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.
ACK 40e2f1e
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.
ACK
tools/hsmtool.c
Outdated
@@ -43,7 +43,7 @@ static void show_usage(const char *progname) | |||
"<path/to/hsm_secret>\n"); | |||
printf(" - guesstoremote <P2WPKH address> <node id> <tries> " | |||
"<path/to/hsm_secret>\n"); | |||
printf(" - generatehsm <path/to/new/hsm_secret>\n"); | |||
printf(" - generatehsm <path/to/new/hsm_secret> [<language_id> <word list> [<password>]"); |
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.
nit: missing last ]
on documentation and additional \n
should be:
[<language_id> <word list> [<password>]]\n
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.
edit: pushed up fix for this!
Based on the patch by bstin <barry.github@capsmx.com>, which added a separate command, this simply extends "generatehsm" to allow more options. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: hsmtool: generatehsm can run non-interactive, taking options on the cmdline.
[ Modified to extend generatehsm --RR ]
5459951
to
165cc01
Compare
Rebased... |
Creating a hsm_file with
hsmtool
is currently an interactive process in terminal where user is expected to make choices for language, typing in seed phrase, etc. This works well, but is difficult to utilize for automated installs (ie. Docker, unattended-installs, etc).This adds a new method:
generatehsmbyargs
that allows the user to input all required args on command-line and generate the hsm_file without terminal interaction.Also the documentation was
lightning-hsmtool.8.md
updated to include new method.All existing functionality was preserved, this only added a new method.