<p>A rough solution:</p>

<p>If the account is in your wallet, you can use:</p>

<p>bitcoind getreceivedbyaddress "ADDRESS"</p>

<p>to get the amount of bitcoins received by ADDRESS. You can put that line inside an infinite loop. You could create a shell program which stores the result in a variable every 30 seconds (using sleep) and compare it to the previous value. If you subtract the values and find a difference above a threshold you can make the script alert you. </p>

<p>I can be more specific if you tell me your preferences (Python, Linux shell...) </p>

CC BY-SA 3.0
2013-05-07T14:47:20.560Z
I'm assuming that won't scale that well for a massive system though?
Peter Fox
CC BY-SA 3.0
2013-05-07T15:31:54.847Z
By massive do you mean with many addresses? In that case you might just check each new block for your addresses. You can use getblock and bitcointools https://github.com/gavinandresen/bitcointools. By the way, the 30 seconds wait time is overkill. If you want confirmed transactions (or transactions that are at least in one block), on average the changes take 10 minutes.
halftimepad
CC BY-SA 3.0
2013-05-07T15:41:37.037Z
Well ideally I want to create a new address, wait until it has a set amount of bitcoins in that address and then transfer the coins and close the address down, doing this for hundreds if not thousands of addresses at a time
Peter Fox
CC BY-SA 3.0
2013-05-07T16:14:52.907Z
I would go for a script calling bitcoind. Or a custom program in Python with bitcointools. I don't think the operations are that complicated. A regular processor should be enough. In any case it seems you will need a bit of work.
halftimepad
CC BY-SA 3.0
2013-05-07T12:06:16.267Z
2013-05-07T12:06:16.267Z
halftimepad
<p>Sorry, I'm probably not going to use the correct terms here.</p>

<p>Does anyone know of, or how to use bitcoind (or of an external library) that can look at or even provide event driven mechanisms to monitor when an address has received equal to or more than a target amount.</p>

<p>I know of the websocket API available from blockchain but I'd ideally do it in house using my own systems if possible.</p>

CC BY-SA 3.0
2013-05-07T12:14:18.033Z
see also: [Push deposit notification through HTTP requests](http://bitcoin.stackexchange.com/questions/2374/push-deposit-notification-through-http-requests)
o0'.
<transactions><development>
Programming a solution to know when a Bitcoin Address has stored a target amount
Peter Fox
# Programming a solution to know when a Bitcoin Address has stored a target amount

(Asked by: username_0 on 2013-05-07)

Sorry, I'm probably not going to use the correct terms here.

Does anyone know of, or how to use bitcoind (or of an external library) that can look at or even provide event driven mechanisms to monitor when an address has received equal to or more than a target amount.

I know of the websocket API available from blockchain but I'd ideally do it in house using my own systems if possible.

**Tags:** transactions, development

> **Comments:**
> **username_1**: see also: [Push deposit notification through HTTP requests](http://bitcoin.stackexchange.com/questions/2374/push-deposit-notification-through-http-requests)  

---

## 1 answers

### Answer by username_2 on 2013-05-07. Score: 2

A rough solution:

If the account is in your wallet, you can use:

bitcoind getreceivedbyaddress "ADDRESS"

to get the amount of bitcoins received by ADDRESS. You can put that line inside an infinite loop. You could create a shell program which stores the result in a variable every 30 seconds (using sleep) and compare it to the previous value. If you subtract the values and find a difference above a threshold you can make the script alert you.

I can be more specific if you tell me your preferences (Python, Linux shell...)

> **Comments:**
> **username_0**: I'm assuming that won't scale that well for a massive system though?  
> **username_2**: By massive do you mean with many addresses? In that case you might just check each new block for your addresses. You can use getblock and bitcointools https://github.com/gavinandresen/bitcointools. By the way, the 30 seconds wait time is overkill. If you want confirmed transactions (or transactions that are at least in one block), on average the changes take 10 minutes.  
> **username_0**: Well ideally I want to create a new address, wait until it has a set amount of bitcoins in that address and then transfer the coins and close the address down, doing this for hundreds if not thousands of addresses at a time  
> **username_2**: I would go for a script calling bitcoind. Or a custom program in Python with bitcointools. I don't think the operations are that complicated. A regular processor should be enough. In any case it seems you will need a bit of work.  

---

