I have a docker instance running a bitcoin node and would like to listen to deposits, generating a new address each time a user requests to deposit then increment the users account balance on success.
walletnotify feature that will notify you when an address you own in your wallet receives a transaction, and a second notification when the transaction confirms.
You can set it in your
walletnotify= curl http://yoururl.com/endpoint.php?tx=%s
%s will contain the transaction id. What you do from there is up to you.
walletnotify callback these are the JSON RPC calls that you would use:
For these calls to work, you need to have a corresponding wallet created or imported into Bitcoin Core. It is also a good idea to set
txindex=1 so you can add pre-existing wallets to Core add hoc.