Author

Topic: Receive Payment Notification (Read 1230 times)

hero member
Activity: 588
Merit: 500
Get ready for PrimeDice Sig Campaign!
August 01, 2014, 02:00:02 PM
#9

I think your best bet is to make more money first, and get a dedicated server that you can run bitcoind on.  Please note, a lot of VPS's out there will kick you off if you're running bitcoind, as it's pretty resource intensive, especially at the beginning while it's downloading the blockchain.


I think I found a solution. I would find the last block, then do getsinceblock every 10 minutes using a cronjob, and get the txid and then get more info from there (blockchain.info/rawtx).
sr. member
Activity: 318
Merit: 251
August 01, 2014, 05:03:02 AM
#8

I think your best bet is to make more money first, and get a dedicated server that you can run bitcoind on.  Please note, a lot of VPS's out there will kick you off if you're running bitcoind, as it's pretty resource intensive, especially at the beginning while it's downloading the blockchain.

hero member
Activity: 588
Merit: 500
Get ready for PrimeDice Sig Campaign!
July 30, 2014, 12:52:15 PM
#7
The blockchain API doesn't support walletnotify or blocknotify.  It is unclear what you mean by "converting fully to a daemon" I incorrectly assumed that would mean you are planning on using bitcoin (the bitcoin daemon) locally.
I am trying to convert my script fully to daemon, instead of having to make accounts and setup those accounts. Instead, you just put in your daemon information, and everything is ready to go. I can't host a daemon on my computer, because I can't trust my internet or computer to be on 100% of the time for a website, and vps is expensive.
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 30, 2014, 12:49:56 PM
#6
The blockchain API doesn't support walletnotify or blocknotify.  It is unclear what you mean by "converting fully to a daemon" I incorrectly assumed that would mean you are planning on using bitcoind (the bitcoin daemon) locally but that doesn't seem to be the case.
hero member
Activity: 588
Merit: 500
Get ready for PrimeDice Sig Campaign!
July 30, 2014, 12:46:54 PM
#5
you add the script to run in your bitcoin.conf:

blocknotify= %s
walletnotify= %s
alertnotify= %s

and when blocks or notifications come in the script will be called with arguments.

for example if you use blocknotify the argument will be the block id e.g. 000000000000000003a5ff0d28a8f9b71623c2328727937160582d1b44cb3cec, if you use walletnotify then the argument will be the new transaction id that came in, e.g. 1e621e60f7ea7195ff1ec7c31867dc7c9d896123ead6ec43f053f51137c31676

make yourself a script (python or your favorite language) that logs the arguments somewhere and test it out with the scenarios you want.
Yes that is what I would like to do, but I am using the blockchain daemon, so I don't have access to their file system or anything. Would it be possible to notify a outside course, like on my website? I don't know if walletnotify works on the blockchain daemon, does anyone know?
newbie
Activity: 25
Merit: 0
July 30, 2014, 02:34:46 AM
#4
you add the script to run in your bitcoin.conf:

blocknotify= %s
walletnotify= %s
alertnotify= %s

and when blocks or notifications come in the script will be called with arguments.

for example if you use blocknotify the argument will be the block id e.g. 000000000000000003a5ff0d28a8f9b71623c2328727937160582d1b44cb3cec, if you use walletnotify then the argument will be the new transaction id that came in, e.g. 1e621e60f7ea7195ff1ec7c31867dc7c9d896123ead6ec43f053f51137c31676

make yourself a script (python or your favorite language) that logs the arguments somewhere and test it out with the scenarios you want.
hero member
Activity: 588
Merit: 500
Get ready for PrimeDice Sig Campaign!
July 29, 2014, 11:48:37 PM
#3
Use walletnotify and blocknotify so your backend is aware when a new payment is received and when a new block is added to the chain.  I am not sure why you think they only work with the GUI, they are normally used with bitcoind.
How would I use this with the blockchain bitcoind though, because wouldn't I have to specify a file to run when there is a notification? ANd when I run this walletnotify command, would it stay on? Please explain how this would work please, I would be very grateful if you did.
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 29, 2014, 11:19:29 PM
#2
Use walletnotify and blocknotify so your backend is aware when a new payment is received and when a new block is added to the chain.  I am not sure why you think they only work with the GUI, they are normally used with bitcoind.
hero member
Activity: 588
Merit: 500
Get ready for PrimeDice Sig Campaign!
July 29, 2014, 11:03:07 PM
#1
I am currently developing a lot of bitcoin sites, all which involve receiving a payment from a buyer. Currently I am using APIs from blockchain and bitcoinmonitor to send payments and get notifications on a payment, but I am converting fully to a daemon, and I need to know how to receive and process transactions, without getting an http notification. So I saw a RPC command: listsinceblock and listtransactions, and those are probably the only solutions, and I know I need to use a cronjob, which I am familiar with. I was thinking of using a cronjob every 5 minutes to do listtransactions, but I will always get old transactions. I was also thinking of doing listsinceblock every 10 minutes, and just get the transactions within the previous block, therefore not getting any old transactions. I know you can use wallet notify in bitcoin-qt, but I am using blockchains daemon, and I don't know how I could get a daemon host (vps too expensive), because I can't leave my computer on all the time, and I can't trust my internet for 100% uptime for a large website.
How would I go about solving this problem? I really need to figure this out.
Thanks for any help!
Jump to: