What problem does your feature solve?
There are inconsistencies in the CLI options available across commands that simulate and send transactions with contract invocations:
-
--send option missing on contract upload and contract deploy: The contract invoke command has a --send option that controls whether to simulate-only or actually send the transaction. This option is not available on contract upload or contract 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 the contract invoke experience.
-
--cost option missing on contract upload and contract deploy: The contract invoke command has a --cost option that provides visibility into the costs paid. This option is not available on contract upload or contract deploy, so users have no visibility into the costs of these operations.
-
--cost option missing on stellar tx simulate: Even when using the workaround of piping to stellar tx simulate, there's no --cost option 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
--send option to contract upload and contract deploy
- Add
--cost option to contract upload and contract deploy
- Add
--cost option to stellar 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-only and pipe to stellar tx simulate (but this still lacks --cost output)
- Pipe the output of
stellar tx simulate to stellar xdr decode to extract cost information from the transaction XDR
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:
--send)--cost)Some examples (not exhaustive):
--sendoption tocontract uploadandcontract deploy--costoption tocontract uploadandcontract deploy--costoption tostellar tx simulateThere 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?
--build-onlyand pipe tostellar tx simulate(but this still lacks--costoutput)stellar tx simulatetostellar xdr decodeto extract cost information from the transaction XDR