Update `contract *` commands to support keys other than local keys

Open
#1,789 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli, security

Research direction

Start by tracing the contract * commands and how they use sign_with_local_key versus sign_with. Compare that flow with the documented --build-only and tx sign --sign-with-key workaround, then verify that direct contract commands can select a non-local key and still build, simulate, sign, and send transactions.

Written by the indexing model from the issue text.

Description

Several of the contract * commands default to signing transactions with the local key (sign_with_local_key), instead of allowing sign_with to decide determine which key type to use.

Perhaps we should refactor this so these commands can sign with a ledger device, or the OS secure store/keychain for a better user experience. However, I will note that there is currently a workaround for this, where the user can run these contract * commands as --build-only and then pipe them to tx sign to sign with a different key.

Workaround:

cargo run contract install --wasm ./hello_world.wasm --source-account zed-secure --network local --build-only | \
cargo run tx simulate --network local --source zed-secure | \
cargo run tx sign --network local --sign-with-key zed-secure | \
cargo run tx send --network local

But, we probably want this instead:

cargo run contract install --wasm ./hello_world.wasm --source-account zed-secure --network local
Dominant language
Rust
Stars
123
Forks
141
Avg merge
2d 21h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli

All issues in stellar/stellar-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.