Allow `contract upload --build-only` without requiring a source account
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust, wasm
- Domain
- blockchain, cli
Research direction
Start at the CLI entry point for stellar contract upload and trace how --build-only validates --source. Confirm completion by building the command without --source and ensuring the resulting transaction can be piped to stellar tx simulate.
Written by the indexing model from the issue text.
Description
What problem does your feature solve?
--build-only should not require a source account. source account can be pass in as optional.
The stellar contract upload --build-only command currently requires a --source account to be specified, even though uploading a contract wasm doesn't involve any authorization. When using --build-only to just build the transaction (e.g., to later simulate it), there's no need for an actual account.
Use case: A developer wants to simulate uploading a contract to mainnet to estimate costs, but doesn't have an account configured. Since the upload operation requires no auth, they should be able to build and simulate the transaction without needing a real account.
Current workaround: On mainnet, you can work around this by specifying any existing account as the source:
stellar contract upload --wasm target/wasm32v1-none/release/test_empty.wasm --build-only --source GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF | stellar tx simulate
This works because the account just needs to exist for the simulation, but it's not intuitive and requires knowing about an arbitrary existing account.
What would you like to see?
When using --build-only, the --source option should either:
- Be optional, with the CLI using a placeholder/zero account automatically, or
- Accept a special value indicating "any account" or "simulation mode"
This would allow commands like:
stellar contract upload --wasm contract.wasm --build-only | stellar tx simulate
What alternatives are there?
- Use any known existing account as
--source(current workaround shown above) - Configure a local identity even when you don't need one
- 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