How can i bundle several transactions intro one to avoid multiple posts to the RPC API?
There is an endpoint at /v1/chain/push_transactions
which takes a payload that is a JSON array of the same JSON transactions you would send to /v1/chain/push_transaction
and returns a JSON array of the results you would get back from the individual calls.
-
1follow up question: will that save the network resources? Will it be more efficient to aggregate and push several transactions in a mini batch? Should we design apps to do this from a centralized server? – Ami Heines May 27 '18 at 12:07
-
2It will save some overhead at the HTTP layer by removing redundant headers. Additionally, for endpoints that support transport encoding this would allow gzip/deflate to be more efficient. It's probably good practice but, it's not a whole lot more efficient yet. – Bart Wyatt May 28 '18 at 16:50