go-sdk
go-sdk copied to clipboard
better integrate BLS key management via hmy and node.sh
Problem/limitation At Hand
The location where BLS keys and Account Keys are generated is a bit confusing. Currently, when you create a new account key, by default it is created on .hmy_cli/account-keys
while when you create a BLS key, it is created within the same directory the hmy binary is located. This is confusing, because on documenation, when you want to run with multiple BLS keys using parameter -M via node.sh, keys are loaded by default from .hmy/blskeys,
folder which has to be created manually by the user. Shouldn't it be .hmy_cli/blskeys
folder instead?
Which component?
- [X] hmy_cli
- [X] node script
Proposed Solution
I propose that when you create a new BLS key via hmy
it should be created by default inside folder .hmy_cli/blskeys
. If the folder doesn't exist, the hmy should create it automatically the first time the user calls the command, the same way it is done when you create an account wallet whereas .hmy_cli/account-keys
is also created automatically in case it doesn't exist.
Also, i propose we modify node.sh
to read by default the keys from .hmy_cli/blskeys
instead of .hmy/blskeys
. So, you keep everything that is HMY related inside hmy_cli, much more organized.
You could extend key list
to list blskeys and accounts, like for example:
./hmy keys list accounts
./hmy keys list blskeys
Now from all bls keys listed via ./hmy keys list blskeys
you can make the hmy
use them as keys for --add-bls-key
, --bls-pubkeys
or whatever parameter that uses any bls key.
Also, i would suggest that we deprecate both parameters -k for ONE key and -M completely on node.sh as i don't see any reason for them to exist now that we have multi BLS key support. Isn't it the same to run with -M or with -k for ONE key?
I believe these suggestions would make both node and hmy more integrated, using the same folders and ease the final user experience.
@Daniel-VDM i am assigning this to you, so you can look and check if my proposal makes any sense. If not you can close it or propose something else.
I love this plan. Makes it simpler for the user. We are literally encouraging someone who is struggling with this right now in the Volunteers chat. Lol
This will make the whole BLS creation process and use of multi BLS much cleaner and straightforward. It would be great to implement this.
Reading the suggestions in this issue cleared up a few questions for me, so I can also say implementing it would be helpful.