batch requests
A batch request is a method for sending several unique requests to the network all at once.
The requests are sent as an array filled with request objects. Results are returned in the order of received requests.
Avoid sending requests that depend on each other. For example, do not send a coin activation and a balance request to that coin in the same batch.
Such requests result in non-deterministic behavior, as the Komodo DeFi Framework API may or may not execute the requests in the desired order.
Structure | Type | Description |
---|---|---|
(none) | array of objects | request objects to be executed in parallel |
Structure | Type | Description |
---|---|---|
(none) | array of objects | the results, provided in the order of received requests; this may contain null elements |
curl --url "http://127.0.0.1:7783" --data "[
{\"method\":\"electrum\",\"coin\":\"DOC\",\"servers\":[{\"url\":\"electrum1.cipig.net:10020\"},{\"url\":\"electrum2.cipig.net:10020\"},{\"url\":\"electrum3.cipig.net:10020\"}],\"userpass\":\"RPC_UserP@SSW0RD\",\"mm2\":1},
{\"method\":\"electrum\",\"coin\":\"MARTY\",\"servers\":[{\"url\":\"electrum1.cipig.net:10021\"},{\"url\":\"electrum2.cipig.net:10021\"},{\"url\":\"electrum3.cipig.net:10021\"}],\"userpass\":\"RPC_UserP@SSW0RD\",\"mm2\":1},
{\"method\":\"electrum\",\"coin\":\"DOC\",\"servers\":[{\"url\":\"electrum1.cipig.net:10020\"},{\"url\":\"electrum2.cipig.net:10020\"},{\"url\":\"electrum3.cipig.net:10020\"}],\"userpass\":\"invalid userpass\",\"mm2\":1}
]"