iota.py
iota.py copied to clipboard
Support for "chunking" requests with size limit
On the IRI, there is a (configurable) size limit for certain requests (https://github.com/iotaledger/iri/blob/v1.4.1.6/src/main/java/com/iota/iri/service/API.java#L111).
This can cause certain requests to fail if the application tries to call e.g., get_balances
with too many addresses.
- Create a new Wrapper (
iota.adapters.wrappers
) that enforces max request limit on certain requests. The default limit is1000
(https://github.com/iotaledger/iri/blob/v1.4.1.6/src/main/java/com/iota/iri/conf/Configuration.java#L118). - Before sending requests for commands that have a size limit, check to see if the request will exceed this limit.
- If any argument will exceed this limit, break the request into chunks.
- For now, send the requests synchronously.
- Compile into a single result before returning.
- If any argument will exceed this limit, break the request into chunks.
For safety, the wrapper should have a [mutable] whitelist of commands that it will operate on.
Bonus points: add support for the other limits as well (maxFindTx
, maxGetTrytes
, etc.).
Related: https://github.com/iotaledger/iri/issues/496