-
Notifications
You must be signed in to change notification settings - Fork 10
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
Changed to allow offline splitting of validator keys with different passwords #69
base: main
Are you sure you want to change the base?
Conversation
@RaekwonIII @IlyaVi Could you please review this PR? |
} | ||
} | ||
else { | ||
keystorePassword = await fsp.readFile(this.args.password, 'utf-8'); |
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.
move this line outside of for loop in line 75
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.
@IlyaVi If this line is moved outside the for loop at line 75, there will be an issue with setting the value of keystoreSet.
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.
@gnongs let me rephrase my comment
what I meant is to have this in line 75
keystorePassword = this.args.password;
this will preserve the same approach as before your change and won't change anything for existing users in the way the use ssv-keys
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.
@IlyaVi
Now I understand your intention.
What you want is for it to behave the same as before when using the same password.
Updated.
|
||
const validatedFiles = await this.validateKeystoreFiles(keystoreSet); | ||
|
||
process.stdout.write(validatedFiles[0].keystoreFile); |
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.
debug print?
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.
Removed!
README.md
Outdated
yarn cli shares --keystore=./keystore-files --password=test --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=.. | ||
## folder structure | ||
keystore_folders | ||
├── 0xe020.... |
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.
validator public key is redundant as folder name - change to something generic
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.
Updated!
README.md
Outdated
|
||
# folder with multiple keystore files | ||
yarn cli shares --keystore=./keystore-files --password=test --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=.. | ||
## folder structure |
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.
Separate this usecase with this sub header
Add comment to underline that --password parameter is actual password file name
"folder structure for keystore files with different password"
Add sub header for one password and multiple files. Command should be the same as before change
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.
Updated.
…fferent password files more clear
@IlyaVi Could you check this again? |
if (dirent.name.includes(this.args.password)) { | ||
keystorePassword = await fsp.readFile(path.join(file, dirent.name), 'utf-8'); | ||
} else { | ||
keystoreFile = path.join(file, dirent.name); |
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.
@gnongs if there are multiple keystore files in same sub directory you will add only last one to the array
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.
Having multiple keystore files is not the folder structure I intend.
Would it be better to terminate the program in such cases?
} | ||
} | ||
else { | ||
keystorePassword = await fsp.readFile(this.args.password, 'utf-8'); |
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.
@gnongs let me rephrase my comment
what I meant is to have this in line 75
keystorePassword = this.args.password;
this will preserve the same approach as before your change and won't change anything for existing users in the way the use ssv-keys
README.md
Outdated
@@ -100,10 +100,39 @@ To run you will use the "shares" command | |||
|
|||
```bash | |||
# single file | |||
yarn cli shares --keystore=keystore.json --password=test --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=.. | |||
yarn cli shares --keystore=./keystore.json --password=./password.txt --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=.. |
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.
please revert this change, user will continue using plane password as parameter
README.md
Outdated
└── keystore5.json | ||
password.txt | ||
|
||
yarn cli shares --keystore=./keystore_files --password=./password.txt --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=.. |
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.
please change to plain password instead file name and remove "password.txt" from folder structure
README.md
Outdated
├── keystore.json | ||
└── password.txt | ||
|
||
yarn cli shares --keystore=./keystore_folders --password=password.txt --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=.. |
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.
instead "password.txt" write here and in the folder structure - the name and extension are not important as long as file can be read as utf-8 encoded text
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 tried to convey that it can be a simple file without an extension.
Hey, @IlyaVi The update is quite late… Sorry.... I have made all the updates to the parts you mentioned, and I have some thoughts on certain areas. Please share your feedback on those comments. :)
|
Fixes #<issue_number_goes_here>