<p>I would recommend that you use blocknotify to execute a CLI PHP script. The script would then use PHP JSON-RPC to call listsinceblock to get the transactions that occurred in the latest block and put them in a MySQL database.</p>

CC BY-SA 3.0
2013-12-07T19:55:52.877Z
2013-12-07T19:55:52.877Z
Bitlab.co
<p>When parsing incoming bitcoin payments, I wanted to show people a record of their topup's. Whenever funds arrived in an address the wallet owned, the -walletnotify callback was run using curl to call the website's URL, and specified the transaction ID. It checked the transaction corresponded to a user (checked the address was in a particular MySQL table). Once this was true, it would be stored with the userid, transaction id, send/receive, and confirmations (=0)</p>

<p>Before they could spend it, 6 confirmations had to pass. So every time the blocknotify trigger was run, it would gather all transactions in the table which had confirmations &lt;50, and rescanned them every time a block came through. At 7 confirmations they were finally credited to the users database.</p>

<p>Since users 'spending' on my site only affected the database I ran into trouble, so if you're considering this you might just go with multi-signature transactions, I'm rewriting to build in support for multisig at the moment.</p>

CC BY-SA 3.0
2014-01-14T00:12:31.077Z
2014-01-14T00:12:31.077Z
karimkorun
<p>Bitcoind has 3 methods </p>

<ul>
<li>blocknotify=cmd</li>
<li>walletnotify=cmd</li>
<li>alertnotify=cmd</li>
</ul>

<p>I understand that these 3 command line parameters needs to be used for get notifications from bitcoin daemon. Could someone suggest how it needs to be integrated or communicate with PHP application.</p>

<bitcoind><php>
Implementing events with the bitcoind notifications using PHP
Abishek R Srikaanth
# Implementing events with the bitcoind notifications using PHP

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

Bitcoind has 3 methods

* blocknotify=cmd
* walletnotify=cmd
* alertnotify=cmd

I understand that these 3 command line parameters needs to be used for get notifications from bitcoin daemon. Could someone suggest how it needs to be integrated or communicate with PHP application.

**Tags:** bitcoind, php


---

## 2 answers

### Answer by username_1 on 2013-12-07. Score: 1

I would recommend that you use blocknotify to execute a CLI PHP script. The script would then use PHP JSON-RPC to call listsinceblock to get the transactions that occurred in the latest block and put them in a MySQL database.


---

### Answer by username_2 on 2014-01-14. Score: 0

When parsing incoming bitcoin payments, I wanted to show people a record of their topup's. Whenever funds arrived in an address the wallet owned, the -walletnotify callback was run using curl to call the website's URL, and specified the transaction ID. It checked the transaction corresponded to a user (checked the address was in a particular MySQL table). Once this was true, it would be stored with the userid, transaction id, send/receive, and confirmations (=0)

Before they could spend it, 6 confirmations had to pass. So every time the blocknotify trigger was run, it would gather all transactions in the table which had confirmations <50, and rescanned them every time a block came through. At 7 confirmations they were finally credited to the users database.

Since users 'spending' on my site only affected the database I ran into trouble, so if you're considering this you might just go with multi-signature transactions, I'm rewriting to build in support for multisig at the moment.


---

