1

In the API CallList: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

You can pass an address as a parameter to "listtransactions" to get the latest list of transactions from an address. What if I would like to get the most recent 25 transactions from a list of 20 addresses. Does this mean I have to make the "listtransactions" call 20 times and then sort the end results?

Calling the API endpoint 20 times is fine, my problem is that if we needed to do pagination that will become very unmanageable very quickly, because it is really hard to determine what is transactions 26-50 from 20 different addresses

Thank you

EDIT: I found that BlockchainInfo offers a very convenient endpoint for this:

https://blockchain.info/api/blockchain_api

Endpoint: http://blockchain.info/multiaddr?active=$address|$address (Multiple addresses divided by |) However, this only returns "txs":[--Latest 50 Transactions--] and, this does not allow you to do an offset (for example, to get transaction 51-100)

  • If you found an answer to your question please post it as an answer. Only use edits to clarify your question. – Stéphane Gimenez Nov 28 '13 at 11:50
  • @StéphaneGimenez, thanks for the notice. Although, I didn't find an answer to my question. I found a partial solution that does not address my needs. – samol Nov 28 '13 at 20:17
3

The most efficient way to get a list of transactions from multiple addresses is to store every wallet transaction in a database locally, something like MySQL or MongoDB, and then run your queries on that database.

You can sync your local database with the Bitcoin wallet via RPC by periodically calling listsinceblock() and keeping track of the last block or by running the client with the optional -walletnotify parameter to run a script to notify your database of new transactions.

Be careful with -walletnotify however. It will be called twice for every transaction and if you have a lot of transactions, it can happen a lot. So make sure the command -walletnotify calls doesn't use a lot of CPU/RAM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.