stellar / stellar-cli

CLI for Soroban contracts.
62 stars 52 forks source link

Enable transaction creation for critical classic commands #1437

Open janewang opened 3 weeks ago

janewang commented 3 weeks ago

What problem does your feature solve?

Support some classic functionalities on the CLI

Operations: https://developers.stellar.org/docs/learn/fundamentals/transactions/list-of-operations

leighmcculloch commented 3 weeks ago

Enable transaction submission for critical classic commands

Is the goal of this command to support submitting the transaction or creating the transaction?

willemneal commented 3 weeks ago

With the new tx sign/send we can handle arbitrary transactions (with no easy way to build them yet). So the idea here was to add a command for each one. Perhaps with the option (baring the invoke) of being able to combine the ops from multiple transactions.

stellar tx create-account --build-only ... |  stellar tx payment --build-only .. | stellar tx sign | stellar tx send 

Thoughts?

leighmcculloch commented 3 weeks ago

Sounds like a cool feature. It competes with the planned stc-like functionality that is described in the following issues. Given the significant amount of effort both are we should probably prioritize one and decide if we want two ways to do something or one.

Or, will tx create-account kick off an stc-like session with a tx template prebuilt with a create-account op?

Do we have any plans for what these commands will look like?

leighmcculloch commented 3 weeks ago

Or maybe tx create-account would only kick off an stc-like session if not all options were provided? Or is the goal for this command to be used in scripting in which case we wouldn't want an stc-like session?

janewang commented 3 weeks ago

@leighmcculloch Sorry about that. I updated the ticket title but forgot to do the same in the Epic. It's now updated: https://github.com/stellar/stellar-cli/issues/1180

Here's from the latest discussions: https://docs.google.com/document/d/1MHjQ-R6Dh_Ykhq5VcOT-d1-z5yoNrPC5RjNA0MEmEno/edit#bookmark=id.1uhcuw5mej48

The edit experience should be able to support multiple operations. Format for editing under consideration: JSON, JSON 5, TOML. We can use –build-only flag to check if the file builds. For non-valid JSON / TOML, we could add comment to indicate there is an error.