4

I would like to be notified of changes to any of my many wallet address as soon as they happen and then programmatically take action. I have been using wallet notify but this has been giving me really inconsistent behavior and I have found that I cannot rely on it.

I'm in search of another solution, and was thinking that I could monitor the blockchain for any changes to addresses I own. Is there some known way to do this?

Other suggestions on how to solve this problem are also appreciated.

  • You can always poll bitcoind for new, unconfirmed transactions only with at least one output pointing to one of the addresses you want to get notified for. listunspent will do the trick for you. – George Kimionis Apr 23 '14 at 13:46
  • Since this is exactly what wallet notify is supposed to do, afaik, instead of reinventing the wheel, it might be better to investigate why it isn't working for you. The cause might be something in your local environment that would also affect any other solution you might create. – Nate Eldredge Jun 25 '14 at 8:49
  • That's what I ended up doing, turned out to be a problem with the queuing library I was using. – Loourr Jun 25 '14 at 15:39
2

You could also use our own Websockets API. More specifically, you need to check the addresses event in order to subscribe to one or multiple address and receive balance updates for them.

An example request command would be:

{
    "event": "addresses:update",
    "filters": {
        "addresses": ["1Biteasym3p5E4soZq8So6NjkjYugEnz2X"]
    }
}

And when the balance is updated you will receive the following response:

{
    "event": "addresses:update",
    "data": {
        "balance": 1746000,
        "total_sent": 0,
        "total_received": 1746000,
        "address": "1Biteasym3p5E4soZq8So6NjkjYugEnz2X"
    }
}
0

I'm working on this problem in my open source project https://github.com/richardkiss/pycoinnet. It ain't quite there yet, but I have a prototype working in the lab.

0

https://blockchain.info/api/api_websocket

With the blockchain.info websocket API you can subscribe to any transactions on addresses. That seems like a great place to start :)

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

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.