Add `--send` and `--cost` options to `contract upload` and `contract deploy` for consistency with `contract invoke`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by tracing the CLI entry points for contract invoke, contract upload, contract deploy, and tx simulate, comparing how their transaction options are defined and handled. Determine the intended shared behavior for --send and --cost, including human-readable cost output. Done means the relevant commands expose consistent options and simulation, sending, and cost reporting work without manual XDR decoding.
Written by the indexing model from the issue text.
Description
What problem does your feature solve?
There are inconsistencies in the CLI options available across commands that simulate and send transactions with contract invocations:
-
--sendoption missing oncontract uploadandcontract deploy: Thecontract invokecommand has a--sendoption that controls whether to simulate-only or actually send the transaction. This option is not available oncontract uploadorcontract deploy, meaning users cannot use the same interface for simulating without sending. The workaround is to use--build-only | stellar tx simulate, but this is inconsistent with thecontract invokeexperience. -
--costoption missing oncontract uploadandcontract deploy: Thecontract invokecommand has a--costoption that provides visibility into the costs paid. This option is not available oncontract uploadorcontract deploy, so users have no visibility into the costs of these operations. -
--costoption missing onstellar tx simulate: Even when using the workaround of piping tostellar tx simulate, there's no--costoption on that command either. Users can get back a simulated transaction, but cannot see human-friendly cost output on the command line without manually decoding the transaction to extract the costs.
Use case: A developer wants to measure ahead of time what the cost of uploading or deploying a contract will be on mainnet. Currently there's no straightforward way to simulate these operations and see the costs without actually submitting the transaction or manually decoding XDR output.
What would you like to see?
Any command that simulates or sends transactions with contract invoke host operations should support a consistent set of options for:
- Deciding whether to simulate-only or send (
--send) - Gaining insight into costs (
--cost)
Some examples (not exhaustive):
- Add
--sendoption tocontract uploadandcontract deploy - Add
--costoption tocontract uploadandcontract deploy - Add
--costoption tostellar tx simulate
There may be other commands that would benefit from these options as well. The general principle is that commands dealing with transaction simulation and submission should have a consistent interface.
What alternatives are there?
- Use
--build-onlyand pipe tostellar tx simulate(but this still lacks--costoutput) - Pipe the output of
stellar tx simulatetostellar xdr decodeto extract cost information from the transaction XDR
- Dominant language
- Rust
- Stars
- 123
- Forks
- 141
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/stellar-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-cli#2384 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stellar/stellar-cli#2347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
stellar/stellar-cli#2723 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
stellar/stellar-cli#2722 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stellar/stellar-cli#2703 ·
All issues in stellar/stellar-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100