Bitcoin Forum

Other => Beginners & Help => Topic started by: Fizpok on April 23, 2013, 07:02:03 AM



Title: How do they provide online bitcoin services?
Post by: Fizpok on April 23, 2013, 07:02:03 AM
Hi,

As I understand, to create an online service you sometimes need to receive bitcoins from one person and send them to another.
Let's leave aside an obvious solution of doing it all on a personal computer. Let's say, I have a web site, and I want it to run the following service:
1. Receive money from A.
2. When confirmed, send money to B.

Normally, you need to query blockchain, with something like bitcoind.
There are some online services that will do it for you.

My question is: how do they do it?
I mean, except for running bitcoind, and then starting another copy of bitcoind to ask for new block info, and to search for "my" addresses - are there other solutions?

Thank you.


Title: Re: How do they provide online bitcoin services?
Post by: Ditto on April 23, 2013, 07:06:16 AM
https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29


Title: Re: How do they provide online bitcoin services?
Post by: Fizpok on April 23, 2013, 10:06:15 AM
https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

So - I still have to run bitcoind in the background, and talk to it from my CGI, am I correct? I mean, the, say, PERL modules they have are USING bitcoind, but do not INCLUDE it?

Do you know if there are examples / sample code, I am looking for PERL?


Title: Re: How do they provide online bitcoin services?
Post by: Come-from-Beyond on April 23, 2013, 10:07:23 AM
Try http://blockchain.info/api


Title: Re: How do they provide online bitcoin services?
Post by: Fizpok on April 23, 2013, 12:10:24 PM
Try http://blockchain.info/api

No. This is a service. What I am trying to find, is how to duplicate it.


Title: Re: How do they provide online bitcoin services?
Post by: Fizpok on April 23, 2013, 02:21:26 PM
Or maybe there is an example, C++, of "check if payment arrived at address" / "send payment to an address"?


Title: Re: How do they provide online bitcoin services?
Post by: Come-from-Beyond on April 23, 2013, 02:29:27 PM
Or maybe there is an example, C++, of "check if payment arrived at address" / "send payment to an address"?

Here is Java example. C++ will be very similar. https://bitcointalk.org/index.php?topic=117640.0


Title: Re: How do they provide online bitcoin services?
Post by: Fizpok on April 23, 2013, 02:45:23 PM
The Java example is a wonderful one :)

Now, back to C++. I am still sure that there are some beginner-friendly JASON examples out there...
Besides, say, I run bitcoind in Windows from cmd, with params. It does work.
But can I run its functions as if it was a DLL? Directly?


Title: Re: How do they provide online bitcoin services?
Post by: daytrader420 on April 23, 2013, 03:06:11 PM
The Java example is a wonderful one :)

Now, back to C++. I am still sure that there are some beginner-friendly JASON examples out there...
Besides, say, I run bitcoind in Windows from cmd, with params. It does work.
But can I run its functions as if it was a DLL? Directly?

When I was developing a little custom shop in PHP to play around with (shop was never released at all), in my testing environment I used standard bitcoin-qt for processing bitcoind commands through JSON.

I'm not quite sure what you're asking about running bitcoind as a DLL.
It stays running in the background communicating through your desired access points(in my case, a shop).
In that manner it is (kind of?) like a dll.
Obviously you wouldn't want bitcoind running as a DLL, I'm not sure about your computer but mine, when I open bitcoin client it is not instant. It takes a while for bitcoin-qt to load.
And that will drag down a lot of time if you are opening/closing bitcoind for each RPC request.


Title: Re: How do they provide online bitcoin services?
Post by: daytrader420 on April 23, 2013, 03:33:49 PM
Sorry for reposting again. I just had another thought on maybe what you meant.

Are you trying to have your own custom DLL, which communicates through bitcoind?

I think that would be possible to do, perhaps you could just use libcurl or WinInet or something which can process your HTTP request in JSON format.


Title: Re: How do they provide online bitcoin services?
Post by: Fizpok on April 24, 2013, 08:11:58 AM
Well, the problem is, I am not sure which approach to take.
I would like to see (in an ideal world) a Microsoft C++ project, with all files (you don't have to download and install libraries that you have no idea how to compile) that runs an app, with options, like
1. scan blockchain, find if there was a payment to a particular address
2. send money to a particular address

If I find it in a human-friendly form, and can compile/run it under Windows, I will be able to continue creating my client app...

Same for web app:
1. I have a Linux-powered web site hosted somewhere
2. I use Perl
3. See above.

Once again, I have already found couple of libraries, that are either too complex (JSON) or half-dead.
I need an example, or, well... I will have to read JSON's code, and the very thought about it makes me depressed :) I know it is a wonderfull library. I just prefer a black box approach.