Author

Topic: IDEA: curl notify from wallet client (for developers) (Read 1952 times)

member
Activity: 68
Merit: 10
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.
legendary
Activity: 1554
Merit: 1008
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 =

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/
Jump to: