-
Notifications
You must be signed in to change notification settings - Fork 2
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
Prepare test CLI for use in Programs repo #856
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4ef15f7
turn cli into lib
JesseAbram 78bc9d6
add changes to store program
JesseAbram 7f711f4
add licence header
JesseAbram efc2507
remove testing utils from cargo toml
JesseAbram 2933cdc
update menmoic handling
JesseAbram 254ce55
update readme
JesseAbram 93135ed
fix reademe mnemonic
JesseAbram a1865d4
add changelog
JesseAbram File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,18 +34,9 @@ When using the local docker compose setup, be aware you need to set the TSS host | |
|
||
## Usage | ||
|
||
### Account names | ||
### Mnemonic | ||
|
||
As this is a test client, there is no private key storage. Instead we use 'account names'. An 'account | ||
name' is a string from which to derive a substrate sr25519 keypair. They are the same as | ||
the account names the command line tool [`subkey`](https://docs.substrate.io/reference/command-line-tools/subkey) uses. | ||
|
||
For example the name `Alice` will give you the same keypair as `subkey inspect //Alice` will give you. | ||
|
||
You can use `subkey inspect` to find the seed, private key and account ID associated with a name you choose. | ||
|
||
With this `test-cli`, giving the `//` prefix is optional. That is, `Alice` and `//Alice` are identical. Note | ||
however that account names are case sensitive, so `//Alice` and `//alice` are different accounts. | ||
As this is a test client, there is no private key storage. Instead we pass in a mnemonic that can be stored as an enviroment variable or passed in on the command line | ||
|
||
### Help | ||
|
||
|
@@ -88,18 +79,14 @@ You also need to decide which ['access mode' or 'key visibility'](https://docs.e | |
you want to register with: private or public. If you are not sure, 'public' is the simplest 'vanilla' | ||
access mode. | ||
|
||
For example, to register with `//Alice` as the signature request account and `//Bob` as the program | ||
modification account, in permissioned access mode, using the `template_barebones` program: | ||
For example, to register with `//Alice` as the signature request account in public access mode, using the `template_barebones` program: | ||
|
||
`entropy-test-cli register Alice public template_barebones.wasm` | ||
`entropy-test-cli register public template_barebones.wasm template_barebones_config_data template_barebones_aux_data //Alice` | ||
|
||
Example of registering in private access mode, with two programs, one given as a binary file and one | ||
Example of registering in public access mode, with two programs, one given as a binary file and one | ||
given as a hash of an existing program: | ||
|
||
`entropy-test-cli register Alice private my-program.wasm 3b3993c957ed9342cbb011eb9029c53fb253345114eff7da5951e98a41ba5ad5` | ||
|
||
When registering with private access mode, a keyshare file will be written to the directory where you | ||
run the command. You must make subsequent `sign` commands in the same directory. | ||
`entropy-test-cli register public my-program.wasm 3b3993c957ed9342cbb011eb9029c53fb253345114eff7da5951e98a41ba5ad5 //Alice` | ||
|
||
If registration was successful you will see the verifying key of your account, which is the public | ||
secp256k1 key of your distributed keypair. You will need this in order to specify the account when | ||
|
@@ -129,7 +116,7 @@ a program you can use the `store-program` command. | |
You need to give the account which will store the program, and the path to a program binary file you | ||
wish to store, for example: | ||
|
||
`entropy-test-cli store-program Alice ./crates/testing-utils/example_barebones_with_auxilary.wasm` | ||
`entropy-test-cli store-program ./crates/testing-utils/example_barebones_with_auxilary.wasm //Alice` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
### Update programs | ||
|
||
|
@@ -138,6 +125,6 @@ account. It takes the signature verifying key, and the program modification acco | |
programs to evaluate when signing. Programs may be given as either the path to a .wasm binary file | ||
or hashes of existing programs. | ||
|
||
`entropy-test-cli update-programs 039fa2a16982fa6176e3fa9ae8dc408386ff040bf91196d3ec0aa981e5ba3fc1bb Alice my-new-program.wasm` | ||
`entropy-test-cli update-programs 039fa2a16982fa6176e3fa9ae8dc408386ff040bf91196d3ec0aa981e5ba3fc1bb my-new-program.wasm //Alice` | ||
|
||
Note that the program modification account must be funded for this to work. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think this will work. Mnemonic is not a positional argument, its an
#[arg(short, long)]
which is given with--mnemonic-option //Alice
or-m //Alice
.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.
good catch