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

CLI: Add support for multi-messages for each tx #13066

Closed
anilcse opened this issue Aug 29, 2022 · 2 comments · Fixed by #13454
Closed

CLI: Add support for multi-messages for each tx #13066

anilcse opened this issue Aug 29, 2022 · 2 comments · Fixed by #13454

Comments

@anilcse
Copy link
Collaborator

anilcse commented Aug 29, 2022

Summary

As a delegator if I want to delegate to multiple validators in a single transaction, there's no default way possible via CLI. Add support for CLI to generate or send multiple messages in a single transaction.

Problem Definition

Currently, though it's all possible from the protocol, CLI doesn't provide a way to generate multiple messges in single transaction. Users either have to use custom scripts or manually edit generated tx files to add multiple messages. Especially teams who have to send multiple payments/delegations are doing this work manually most of the times.

Proposal

Option-1: Add a flag --multi or --multiple for each txn, which will take either comma separated list of arguments to generate multiple messages.
Ex:

simd tx bank send to_addr1 amount1 --multi to_addr2,amount2,to_addr3,amount3,... --from from_addr

Option-2: Add a flag --multi or --multiple which takes a csv input for each txn and generates multiple messages.
Ex:

simd tx bank send to_addr1 amount1 --multi multi.csv --from from_addr

Where multi.csv would have the list of to_address, amount fields for MsgSend message. Similarly it will have validator_addr, delegation_amount for delegation transaction.

@alexanderbez
Copy link
Contributor

alexanderbez commented Aug 30, 2022

Wouldn't it be better to generalize this? Meaning, we already have a means to generate unsigned txs. A user would generate 2 or more unsigned txs and then take those files and supply them to a command that constructs a signed multi-msg tx.

E.g.

$ simd tx bank send <args...|flags...> --generate-only > tx1.json
$ simd tx staking delegate <args...|flags...> --generate-only > tx2.json
...
$ simd tx multi-msg tx1.json tx2.json <args...|flags...> > tx.json

@anilcse
Copy link
Collaborator Author

anilcse commented Aug 30, 2022

That sounds great, like it. We can also combine both solutions if others see value in both options.

@julienrbrt julienrbrt self-assigned this Oct 5, 2022
@julienrbrt julienrbrt moved this from 📝 Todo to 💪 In Progress in Cosmos-SDK Oct 5, 2022
@julienrbrt julienrbrt moved this to 📝 Todo in Cosmos-SDK Oct 5, 2022
@julienrbrt julienrbrt moved this from 💪 In Progress to 👀 Needs Review in Cosmos-SDK Oct 5, 2022
Repository owner moved this from 👀 Needs Review to 👏 Done in Cosmos-SDK Oct 7, 2022
@tac0turtle tac0turtle removed this from Cosmos-SDK Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants