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

Command to add a key to a configured chain in the relayer #363

Closed
7 of 12 tasks
andynog opened this issue Nov 5, 2020 · 2 comments · Fixed by #408
Closed
7 of 12 tasks

Command to add a key to a configured chain in the relayer #363

andynog opened this issue Nov 5, 2020 · 2 comments · Fixed by #408
Assignees
Labels
I: CLI Internal: related to the relayer's CLI I: logic Internal: related to the relaying logic
Milestone

Comments

@andynog
Copy link
Contributor

andynog commented Nov 5, 2020

Crate

relayer-cli
relayer

Summary

This feature will implement a command to the relayer that will allow users to add keys to a chain configured on the relayer.

Problem Definition

Right now to test a transaction command (e.g. tx raw) the user needs to specify a flag (-k) which is the key_seed.json file every time a transaction is submitted. When this feature implemented, this flag will not be needed anymore. The users would have to run a keys add command once and that will add the key to the relayer home folder.

Proposal

  • Implement command to the relayer to add keys
  • Remove the key flag (-k) from the tx raw commands
  • The added key specified in the config should be used to sign transactions
  • Keys are stored in the relayer home folder (unencrypted)
  • Perform regression and integration test
  • Bonus: Added keys list command
  • Add instructions to add keys on README

Assumptions

  • This will not implement a keychain or keyring.
  • The keys to be imported should be generated with gaiad and exported (e.g. key_seed.json).
  • The key file will be stored in the relayer home folder exactly like they were exported.
  • The key name should be specified in the relayer config file (.toml)

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@andynog andynog added I: CLI Internal: related to the relayer's CLI I: logic Internal: related to the relaying logic labels Nov 5, 2020
@adizere adizere added this to the v0.0.5 milestone Nov 6, 2020
@adizere adizere mentioned this issue Nov 9, 2020
42 tasks
@andynog andynog self-assigned this Nov 10, 2020
andynog added a commit that referenced this issue Nov 11, 2020
andynog added a commit that referenced this issue Nov 11, 2020
andynog added a commit that referenced this issue Nov 18, 2020
- Added a new test keyring backend to support adding keys to file system (under home folder)
- Refactored logic to add key to be part of the keystore and not the command
- Switched the keybase on a chain to use the test keyring
- Key seed file is saved in the test keystore default folder (/home/andy/.rrly)
andynog added a commit that referenced this issue Nov 18, 2020
@andynog
Copy link
Contributor Author

andynog commented Nov 18, 2020

Most of the logic to have this working is implemented. The only things missing is to add instructions on README and do some regression and integration tests. If all works well will open a PR tomorrow for this.

andynog added a commit that referenced this issue Nov 19, 2020
- Clean up remaining key_seed flag for tx cmds
- Refactored keybase to include chain config
- Refactoring keyring methods to use chain config
- Logic to use configured key to sign tx
andynog added a commit that referenced this issue Nov 19, 2020
@andynog
Copy link
Contributor Author

andynog commented Nov 19, 2020

Tested conn-init command against a cosmos-test-stargate chain and using the new keys add command and it works. Will update the instructions on README with new way to submit transactions.

andynog added a commit that referenced this issue Nov 19, 2020
romac pushed a commit that referenced this issue Nov 24, 2020
* Added logic to generate GRPC client from cosmos.auth proto (#337)

* Adding logic to use GRPC client (#337)

* Grpc client connection retrieves account sequence (#337)

* Removed the account sequence flag from the tx raw commands (#337)

* Removed instructions to query and specify account sequence from tx raw command (#337)

* Logic to fetch GRPC endpoint address from config (#337)

* Fixing tests (#361)

* Logic to use the address from the key seed (#337)

* Added boilerplate code for a keys add command to the relayer (#363)

* Removing key flag from tx cmds

* Adding logic to get key specified in the config

* Logic to get the key specified in the config (#363)

* Removed the -k flag from the tx raw commands (#363)

* More logic to add key command (#363)

* key add command for memory store working (#363)

* Added logic to persist key seed in 'home' folder (#363)

* Changes implemented (#363):
- Added a new test keyring backend to support adding keys to file system (under home folder)
- Refactored logic to add key to be part of the keystore and not the command
- Switched the keybase on a chain to use the test keyring
- Key seed file is saved in the test keystore default folder (/home/andy/.rrly)

* Logic to use the key_name parameter from the config to add key. Removed name parameter from keys add cmd (#363)

* Changed the logic to get the key from the test keyring file store (#363)

* Implemented changes: (#363)
- Clean up remaining key_seed flag for tx cmds
- Refactored keybase to include chain config
- Refactoring keyring methods to use chain config
- Logic to use configured key to sign tx

* Updated the README instructions (#363)

* Disable the 'keys restore' command for now (#363)

* Added 'keys list' command to show key added on a chain (#363)

* Added entry for issue #363 (PR #408)

* Refactored the bound variables to use the full name per comment suggestion (#408)

* Move key retrieval, memo and timeout height inside send_tx

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
adizere pushed a commit that referenced this issue Nov 27, 2020
* Added logic to generate GRPC client from cosmos.auth proto (#337)

* Adding logic to use GRPC client (#337)

* Grpc client connection retrieves account sequence (#337)

* Removed the account sequence flag from the tx raw commands (#337)

* Removed instructions to query and specify account sequence from tx raw command (#337)

* Logic to fetch GRPC endpoint address from config (#337)

* Fixing tests (#361)

* Logic to use the address from the key seed (#337)

* Added boilerplate code for a keys add command to the relayer (#363)

* Removing key flag from tx cmds

* Adding logic to get key specified in the config

* Logic to get the key specified in the config (#363)

* Removed the -k flag from the tx raw commands (#363)

* More logic to add key command (#363)

* key add command for memory store working (#363)

* Added logic to persist key seed in 'home' folder (#363)

* Changes implemented (#363):
- Added a new test keyring backend to support adding keys to file system (under home folder)
- Refactored logic to add key to be part of the keystore and not the command
- Switched the keybase on a chain to use the test keyring
- Key seed file is saved in the test keystore default folder (/home/andy/.rrly)

* Logic to use the key_name parameter from the config to add key. Removed name parameter from keys add cmd (#363)

* Changed the logic to get the key from the test keyring file store (#363)

* Implemented changes: (#363)
- Clean up remaining key_seed flag for tx cmds
- Refactored keybase to include chain config
- Refactoring keyring methods to use chain config
- Logic to use configured key to sign tx

* Updated the README instructions (#363)

* Disable the 'keys restore' command for now (#363)

* Added 'keys list' command to show key added on a chain (#363)

* Added entry for issue #363 (PR #408)

* Refactored the bound variables to use the full name per comment suggestion (#408)

* Move key retrieval, memo and timeout height inside send_tx

* Add the client creation, connection and channel handshake

* remove sleeps

* More error handling, cleanup

* Macro for channel CLIs

* Macro for connection CLIs

* Where src/dst make no sense rename to a/b, also fix a few bugs after last commits

* cleanup

* cargo fmt

* Use Romain's skip-verif until backwards verification is done

* fix CLI bugs

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this issue Sep 13, 2022
* Added logic to generate GRPC client from cosmos.auth proto (#337)

* Adding logic to use GRPC client (#337)

* Grpc client connection retrieves account sequence (#337)

* Removed the account sequence flag from the tx raw commands (#337)

* Removed instructions to query and specify account sequence from tx raw command (#337)

* Logic to fetch GRPC endpoint address from config (#337)

* Fixing tests (informalsystems#361)

* Logic to use the address from the key seed (#337)

* Added boilerplate code for a keys add command to the relayer (informalsystems#363)

* Removing key flag from tx cmds

* Adding logic to get key specified in the config

* Logic to get the key specified in the config (informalsystems#363)

* Removed the -k flag from the tx raw commands (informalsystems#363)

* More logic to add key command (informalsystems#363)

* key add command for memory store working (informalsystems#363)

* Added logic to persist key seed in 'home' folder (informalsystems#363)

* Changes implemented (informalsystems#363):
- Added a new test keyring backend to support adding keys to file system (under home folder)
- Refactored logic to add key to be part of the keystore and not the command
- Switched the keybase on a chain to use the test keyring
- Key seed file is saved in the test keystore default folder (/home/andy/.rrly)

* Logic to use the key_name parameter from the config to add key. Removed name parameter from keys add cmd (informalsystems#363)

* Changed the logic to get the key from the test keyring file store (informalsystems#363)

* Implemented changes: (informalsystems#363)
- Clean up remaining key_seed flag for tx cmds
- Refactored keybase to include chain config
- Refactoring keyring methods to use chain config
- Logic to use configured key to sign tx

* Updated the README instructions (informalsystems#363)

* Disable the 'keys restore' command for now (informalsystems#363)

* Added 'keys list' command to show key added on a chain (informalsystems#363)

* Added entry for issue informalsystems#363 (PR informalsystems#408)

* Refactored the bound variables to use the full name per comment suggestion (informalsystems#408)

* Move key retrieval, memo and timeout height inside send_tx

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this issue Sep 13, 2022
* Added logic to generate GRPC client from cosmos.auth proto (#337)

* Adding logic to use GRPC client (#337)

* Grpc client connection retrieves account sequence (#337)

* Removed the account sequence flag from the tx raw commands (#337)

* Removed instructions to query and specify account sequence from tx raw command (#337)

* Logic to fetch GRPC endpoint address from config (#337)

* Fixing tests (informalsystems#361)

* Logic to use the address from the key seed (#337)

* Added boilerplate code for a keys add command to the relayer (informalsystems#363)

* Removing key flag from tx cmds

* Adding logic to get key specified in the config

* Logic to get the key specified in the config (informalsystems#363)

* Removed the -k flag from the tx raw commands (informalsystems#363)

* More logic to add key command (informalsystems#363)

* key add command for memory store working (informalsystems#363)

* Added logic to persist key seed in 'home' folder (informalsystems#363)

* Changes implemented (informalsystems#363):
- Added a new test keyring backend to support adding keys to file system (under home folder)
- Refactored logic to add key to be part of the keystore and not the command
- Switched the keybase on a chain to use the test keyring
- Key seed file is saved in the test keystore default folder (/home/andy/.rrly)

* Logic to use the key_name parameter from the config to add key. Removed name parameter from keys add cmd (informalsystems#363)

* Changed the logic to get the key from the test keyring file store (informalsystems#363)

* Implemented changes: (informalsystems#363)
- Clean up remaining key_seed flag for tx cmds
- Refactored keybase to include chain config
- Refactoring keyring methods to use chain config
- Logic to use configured key to sign tx

* Updated the README instructions (informalsystems#363)

* Disable the 'keys restore' command for now (informalsystems#363)

* Added 'keys list' command to show key added on a chain (informalsystems#363)

* Added entry for issue informalsystems#363 (PR informalsystems#408)

* Refactored the bound variables to use the full name per comment suggestion (informalsystems#408)

* Move key retrieval, memo and timeout height inside send_tx

* Add the client creation, connection and channel handshake

* remove sleeps

* More error handling, cleanup

* Macro for channel CLIs

* Macro for connection CLIs

* Where src/dst make no sense rename to a/b, also fix a few bugs after last commits

* cleanup

* cargo fmt

* Use Romain's skip-verif until backwards verification is done

* fix CLI bugs

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI I: logic Internal: related to the relaying logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants