Bitcoin Forum
November 07, 2024, 07:42:56 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: IDEA: curl notify from wallet client (for developers)  (Read 1950 times)
icreator (OP)
Legendary
*
Offline Offline

Activity: 1554
Merit: 1008



View Profile WWW
September 28, 2013, 05:16:35 AM
 #1

For simple and quick notify by wallet client to others applications please add a new ability:

1. add a parameters in .conf file:
%A - abbreviation, for example BTC, CLR
%b - block hash
%t - list of new transactions
%N - full name of xcurr, for example 'Bitcoin', 'CopperLark'
%n - name for make URI, for example bitcoin, copperlark = <a href=bitcoin:1wer87...</a>

2. add command in bitcoin.conf:
# on new block received
curl_on_block =  http://127.0.0.1:8000/some_URL/%A/%b

3. add command in bitcoin.conf:
# on new transactions for this wallet received
curl_on_trans =  http://127.0.0.1:8000/some_URL/%A/%t

use for this abilities a curl lib from here http://curl.haxx.se/

Erachain Blockchain is fully ready for use Digital Ecosystem based on blockchain technology for business and government with low transaction costs, identification and built-in functions.
+Decentralized exchange of tokens in Erachain
johba
Member
**
Offline Offline

Activity: 68
Merit: 10



View Profile WWW
September 29, 2013, 11:15:29 AM
 #2

Hi!

I'm not sure what you mean by wallet client, but you are referring to the bitcoind config file, so I'll talk about bitcoind.

If you check out this link: https://en.bitcoin.it/wiki/Running_Bitcoin you will find 3 notify commands to start bitcoind with.

like so for example:

./bitcoind  -blocknotify="echo '%s' | nc 127.0.0.1 4001"
              -walletnotify="echo '%s' | nc 127.0.0.1 4002"
              -alertnotify="echo '%s' | nc 127.0.0.1 4003"
              -daemon

netcat (nc) will write %s to a tcp port, %s is transaction id or block id. with those you can go ahead and query the api for details. I've put it into some code here: https://github.com/johannbarbie/BitcoindClient4J

Hope that's what you meant.
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!