Bitcoin Forum
June 14, 2024, 06:40:33 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind transaction notification  (Read 3447 times)
Vantix (OP)
Hero Member
*****
Offline Offline

Activity: 556
Merit: 501

CryptoTalk.Org - Get Paid for every Post!


View Profile
May 28, 2013, 01:26:27 PM
 #1

What is the best way to get an HTTP callback when bitcoind client receive an input/output transaction?

Thank you all

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
May 28, 2013, 02:05:14 PM
Last edit: May 28, 2013, 02:20:45 PM by Stephen Gornick
 #2

What is the best way to get an HTTP callback when bitcoind client receive an input/output transaction?

Thank you all

The Bitcoin-Qt/bitcoind client does not have any callback, so the main method employed currently is to poll the client to discover new transactions (using listsinceblock).

BitcoinJ does support this with a PeerEventListener interface:
 - http://bitcoin.stackexchange.com/a/8133/153

Also, BitsOfProof possibly supports a callback for new transactions as well.

[Edit: And most payment processors, e.g., BitPay,  provide this within their API.]

[Edit2: And you can configure Blockchain.info/wallet to notify you:
 - http://blockchain.info/wallet/payment-notifications ]

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Zeilap
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
May 28, 2013, 02:16:52 PM
 #3

Actually, there are two command line switches -blocknotify and -walletnotify which will call a command when a block is found and when transactions arrive.

Honestly, I would avoid using listsinceblock, it doesn't behave as you'd expect and it'll come back to bite you.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
May 28, 2013, 02:22:27 PM
 #4

The 8.2 release candidates include a -walletnotify option that can run a process when a transaction that affects the wallet is seen.  It would be fairly simple to write a script for that to call curl or wget to create a HTTP callback.

If your bitcoind is busy (or will be some day), or if the callback server is unreliable, it would be wiser to do it in two stages.  The -walletnotify could drop an entry into a database, and a second process could read those entries and execute the calls.  The reason is that the -walletnotify process needs to return promptly to avoid runaway processes.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
May 28, 2013, 02:26:18 PM
 #5

Actually, there are two command line switches -blocknotify and -walletnotify which will call a command when a block is found and when transactions arrive.

Ah, thanks for that!

Here's more info on it:

How to use Walletnotify?
 - http://bitcointalk.org/index.php?topic=203438.0

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!