Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: nomantariq18 on April 04, 2018, 04:39:39 PM



Title: call back functionality in Bitcoin core Wallet
Post by: nomantariq18 on April 04, 2018, 04:39:39 PM
is there any functionality that when transaction received in the wallet than it call a specific URL and update transaction in my local DB?


Title: Re: call back functionality in Bitcoin core Wallet
Post by: starmyc on April 04, 2018, 05:21:12 PM
is there any functionality that when transaction received in the wallet than it call a specific URL and update transaction in my local DB?

No, there is no such kind of thing, but that would be easy to add in my opinion, patching Bitcoin Core or using a third party software dedicated to this task.


Title: Re: call back functionality in Bitcoin core Wallet
Post by: DannyHamilton on April 04, 2018, 06:24:34 PM
starmyc is incorrect.


You have BOTH:
  • blocknotify
and
  • walletnotify


blocknotify will execute whenever Bitcoin Core receives a new block.

walletnotify will execute whenever Bitcoin Core receives a transaction that is associated with an address that belongs to the wallet that Bitcoin Core is running with.

Between the two of those, along with the other RPC commands available, you should be able to build something robust.



Title: Re: call back functionality in Bitcoin core Wallet
Post by: starmyc on April 04, 2018, 08:27:36 PM
starmyc is incorrect.

This is harsh (and incorrect too :) ).

You have BOTH:
  • blocknotify
and
  • walletnotify

blocknotify will execute whenever Bitcoin Core receives a new block.

walletnotify will execute whenever Bitcoin Core receives a transaction that is associated with an address that belongs to the wallet that Bitcoin Core is running with.

Between the two of those, along with the other RPC commands available, you should be able to build something robust.

The question is about calling back an URL, and those calls can only be used to launch an external program, not call an url as asked. You'll still need a 3rd party program to answer the initial need, as I proposed initially.


Title: Re: call back functionality in Bitcoin core Wallet
Post by: HCP on April 05, 2018, 05:01:32 AM
That's really splitting hairs... If the "external program" is a simple script that launches "curl" or something similar... then yes, you are effectively "calling back an URL".  And it certainly doesn't require patching Bitcoin Core.

You can definitely use blocknotify and walletnotify as mentioned by Danny. Something like the setup described here: https://bitcointalk.org/index.php?topic=448565.msg4933145#msg4933145 would achieve the desired result.

Even if it is calling an "external program", the end result is that a URL is called when a transaction occurs... as per the OPs requirement.