Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Bungeebones on April 22, 2014, 09:35:55 PM



Title: Is a programmable client possible?
Post by: Bungeebones on April 22, 2014, 09:35:55 PM
Does anyone know if it would be feasible to make a programmable client that would take any input and send the output to a series of other clients?

For example, a payment of 1 BTC comes in and it sends:

.5 BTC to one client
.25 BTC to another client
.125 BTC to yet another
.0625 BTC to another

... and so forth.

And a related question. Would it be possible to to program a client to send outputs using a chron?


The way I would use the two would be to have the chron send a daily spend to the second which then would take that amount and divide it up to the other clients.



Title: Re: Is a programmable client possible?
Post by: mcaizgk2 on April 22, 2014, 09:47:12 PM
Absolutely. All necessary functionality is exposed through bitcoind's JSON-RPC API so all you really have to do is to find an appropriate wrapper for the programming language you wish to build your client with and build it. You can then call your client with chron.

These will help you get the ball rolling: JSON-RPC API reference (https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29) and Original Bitcoin client/API calls list (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)


Title: Re: Is a programmable client possible?
Post by: mailmansDOG on April 22, 2014, 09:50:43 PM
Things get advanced quickly. As the post above mine sais, you need to know programming. If you do then I wish you good luck. Oh and aslo, there might be some open source projects for what you're looking to make. Try looking it up on github.


Title: Re: Is a programmable client possible?
Post by: cp1 on April 22, 2014, 09:53:26 PM
Should be easy, just query bitcoind if a certain transaction has taken place and then send to whatever addresses you want.  Easy enough for a few lines and just add the script to your crontab.


Title: Re: Is a programmable client possible?
Post by: Bungeebones on April 23, 2014, 12:49:51 AM
Awesome responses! I was playing with bitcoind last month and had to set it aside for a bit. I'm fair at php and currently have php set up to receive a http callback from bitcoinmonitor.net and then record the transaction in my own records so this would just be along the same lines.


I was trying to do it on my own and without Bitcoinmonitor too. I was "almost there" to where it would pick up a transaction but not quite. I can't quite remember my hangup so I'll have to blow the dust off my notes and get back into it.

Sometimes it's hard to see the forest through the trees :-)

Thanks all!