1
curl -s 'localhost:26657/broadcast_tx_commit?tx="zid=1 title=xyz"'

Can something be done like this?

I want to store multiple data in a single transaction, so can it be done using key value pairs or any other technique that would work?

renny
  • 590
  • 4
  • 23

2 Answers2

1

Yes, because it's up to you on how your application parses the transaction. If your application (sounds like a key-value database) can accept multiple key-value pairs separated by a space like in your example, then this'll work fine.

See the kvstore example. You could easily modify it to accept multiple key-value pairs.

David
  • 170
  • 2
  • 9
0

Yes, here is the correct syntax to use it:

curl -s 'localhost:26657/broadcast_tx_commit?tx="zid=1"&tx="title=xyz"'

Since 'tx' itself is a key in order to input multiple key you need to add it as a transaction itself.

theletz
  • 1,713
  • 2
  • 16
  • 22