4

I'm developing a system which should monitor incoming transactions for the local addresses (addresses in this node's wallet).

It would be great to use high-performance ZeroMQ for this. Is it possible?

I know I can receive notifications about new transactions from it. But notification only contains transaction ID. How do I know if it's related to one of the local addresses?

Do I need to make RPC call for each transaction to find it's output address? This seems extremely ineffective, cause there a lot of new transactions and by making so many RPC calls I will just flood the server.

Is there a better option?

2 Answers 2

5

Actually, it's pretty much possible!

You will have to listen for rawtx topic of ZeroMQ in order to retrieve binary representation of the transaction descriptor.

Then you should parse the transaction body and extract Bitcoin addresses from it's output scripts. You could either do this manually, or use some third-party library. No need to make RPC calls!

References:

2

I'm pretty much doing the same thing. I recommend you to use distributed cache services such as Redis for your addresses' storage and query against that database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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