3

With getrawmempool it gets me txids, however it just dumps the whole mempool on me. This isn't convenient if I want to quickly detect new transactions. Is it possible to only get newly broadcasted transactions?

Is there another way to sort of stream them from bitcoin-core into my program?

4

You can use the ZMQ interface to receive a ZMQ notification when a new transaction is received. You can have it give you the txid, the raw transaction, or both.

0
0

I think what you are looking for is walletnotify. You can set on bitcoin.conf file.

For example

walletnotify=/home/process_tx.sh

That will call /home/process_tx.sh passing as parameter the transaction hash Or you can also run bitcoind with using -walletnotify

bitcoind -walletnotify=/home/process_tx.sh

2
  • 1
    As far as I understand, walletnotify only notifies of transactions made to the address that belong to that wallet. I'm interested in collecting all transactions that are broadcasted.
    – snitko
    Aug 17 '17 at 4:20
  • In that case, you should use ZMQ as sugest by @Andrew Chow
    – carvmarc
    Aug 17 '17 at 15:08

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.