soroban-cli icon indicating copy to clipboard operation
soroban-cli copied to clipboard

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

Open elizabethengelman opened this issue 11 months ago • 0 comments

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

elizabethengelman avatar Dec 11 '24 17:12 elizabethengelman