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

Changed to allow offline splitting of validator keys with different passwords #69

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,38 @@ To run you will use the "shares" command

**Input parameters:**
- keystore (ks) = The path to either a validator keystore file or a folder that contains multiple validator keystore files. If a folder is provided, it will split in bulk all the keystore files within it according to the additional arguments provided
- password (ps) = The keystore file encryption password, if a folder was provided the password will be used for all keystore files in the folder
- password (ps) = The keystore file encryption password. For one keystore, enter the absolute path. For multiple keystores, enter only the password file name.
- operator-ids (oids) = Comma-separated list of operator IDs. The amount must be 3f+1 compatible
- operator-keys (oks) = Comma-separated list of operator keys (same sequence as operator ids). The amount must be 3f+1 compatible
- output-folder (of) = Target folder path to output the key shares file
- owner-address (oa) = The cluster owner address (in the SSV contract)
- owner-nonce (on) = The validator registration nonce of the account (owner address) within the SSV contract (increments after each validator registration), obtained using the ssv-scanner tool

```bash

6 directories, 20 files
# 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=..
Copy link
Contributor

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


# 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
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated.

keystore_folders
├── 0xe020....
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated!

│   ├── keystore-m_12381_3600_1_0_0-1717971132.json
│   └── password.txt
├── 0xe025....
│   ├── keystore-m_12381_3600_6_0_0-1717971134.json
│   └── password.txt
├── 0xe02a....
│   ├── keystore-m_12381_3600_11_0_0-1717971135.json
│   └── password.txt
├── 0xe02f....
│   ├── keystore-m_12381_3600_16_0_0-1717971137.json
│   └── password.txt
└── 0xe034....
├── keystore-m_12381_3600_21_0_0-1717971139.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=..
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

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

@IlyaVi

I tried to convey that it can be a simple file without an extension.

```

**Output:** Name will start with keyshares-timestamp.json
Expand Down
47 changes: 35 additions & 12 deletions dist/tsc/src/commands/actions/KeySharesAction.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tsc/src/commands/actions/KeySharesAction.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading