iotaledger / iota.py

PyOTA: The IOTA Python API Library
https://docs.iota.org/
MIT License
345 stars 124 forks source link

if I have 1000 000 address. how to check some address had deposit? #215

Open purplecity opened 5 years ago

purplecity commented 5 years ago

should I invoke getBalance or findTransactions a million times?

purplecity commented 5 years ago

Dear @todofixthis I represent Bithumb.global exchange(comming soon).Boss let me complete iota wallet for our exchange. I have many technical questions to consult and could u give me a contract information? I have emailed contract@iota.org

todofixthis commented 5 years ago

Hey @purplecity ! Couple of thoughts here:

Using a vanilla IRI node, I think your best bet is to call get_balances(). You can provide up to 1000 addresses (this limit is customisable on the node; see #138 for more information).

If you're going to do this regularly, it might be worthwhile to run an IRI node, and interface with its local database directly — avoids all of the overhead associated with the HTTP API.

Alternatively, you might consider writing an IXI module, which will allow you to write your own custom HTTP API commands. You can optimise it for specific use cases to get the best performance.

purplecity commented 5 years ago

is there any way to get all transaction between two milestone? if have I can filter transaction or address which I need monitor. after all,nether the HTTP API or ZMQ is't suitable to monitor million address

todofixthis commented 5 years ago

Hmmm, interesting.

PyOTA isn't really designed for the use case you are describing, unfortunately; I think that you will have a better chance of success implementing a direct interface to the IRI process and/or the underlying RocksDB instance.

Try posting on these sources to get attention from IRI core devs: