Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsure how to use the tx edit and tx new commands #1962

Open
leighmcculloch opened this issue Mar 14, 2025 · 4 comments
Open

Unsure how to use the tx edit and tx new commands #1962

leighmcculloch opened this issue Mar 14, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@leighmcculloch
Copy link
Member

What version are you using?

e473057

What did you do?

$ stellar tx edit
❌ error: No stdin detected
$ ~/.cargo/bin/stellar tx new set-options
ℹ️ Signing transaction: fc78e5322dc383c51abc4e107bee65a355f1f9c551eaa87377f0779829c3dc59

What did you expect to see? vs What did you see instead?

In the first case I thought it was going to open an editor for building a tx, but it seems to require stdin.

In the second case, I tried to build a tx to then pass into tx edit, but it signed a transaction and I don't know what it did with the transaction after that. Did it submit the tx?

It was surprising that the second command automatically signed the tx, given that we also have the tx sign command for doing that. These commands are a little more lower level than the commands that build txs as part of deploying and invoking, so I expected them to do less, and to do the minimal I told them to do.

@leighmcculloch leighmcculloch added the bug Something isn't working label Mar 14, 2025
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Mar 14, 2025
@leighmcculloch
Copy link
Member Author

Trying some more things, and still not getting it right:

$ stellar tx new set-options | stellar tx edit
ℹ️ Signing transaction: 2c03c6d86434753d3cb7712375e27d0d246ce5cbe4ac9ca10884a286e8711976
❌ error: failed to fill whole buffer

@leighmcculloch
Copy link
Member Author

leighmcculloch commented Mar 14, 2025

Okay, figured it out after a few more tries:

$ stellar tx new set-options --build-only | stellar tx edit

The need to pass --build-only is consistent with other commands like stellar contract deploy and stellar contract invoke, it just wasn't obvious to me that a command named tx new was going to also submit it, given that "new" makes it sound like it's just creating a tx as a starting point.

Especially in the context of this help:

$ stellar tx
Sign, Simulate, and Send transactions

Usage: stellar tx [OPTIONS] <COMMAND>

Commands:
  hash       Calculate the hash of a transaction envelope
  new        Create a new transaction
  operation  Manipulate the operations in a transaction, including adding new operations [aliases: op]
  send       Send a transaction envelope to the network
  sign       Sign a transaction envelope appending the signature to the envelope
  simulate   Simulate a transaction envelope from stdin

When I see new, then sign and send, it looks like these commands by default are used together, where-as new with it's current behaviour tries to do them all.

Could we consider changing new so it doesn't sign and doesn't send?

@leighmcculloch
Copy link
Member Author

❌ error: No stdin detected

For this error, can we include some output telling the user how to create the transaction using stellar tx new?

@leighmcculloch
Copy link
Member Author

leighmcculloch commented Mar 14, 2025

$ stellar tx new set-options
ℹ️ Signing transaction: fc78e5322dc383c51abc4e107bee65a355f1f9c551eaa87377f0779829c3dc59

I think some of my confusion came about because this command, and lots of other commands, inform the user when signing is occurring, but not when sending the tx is occurring.

Another example is:

$ stellar contract asset deploy --asset ABC:$(stellar keys public-key issuer)
ℹ️ Signing transaction: 2692943fe8cdc92336385163ab7f83f88c219883cda6fa20519fc7dbb789b10c
CDRRI3XWPIMVEYADS7MH4BFU677CCCJWVF3VYOPHXEY6XTQGKVUEF3ZK

It's not necessarily intuitive to a user that the send is occurring. It's implied and a little more obvious in cases like the deploy command, but not in others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog (Not Ready)
Development

No branches or pull requests

1 participant