Bitcoin Forum
July 29, 2024, 04:21:43 PM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do they provide online bitcoin services?  (Read 537 times)
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
April 23, 2013, 07:02:03 AM
 #1

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.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Ditto
Sr. Member
****
Offline Offline

Activity: 330
Merit: 250


View Profile
April 23, 2013, 07:06:16 AM
 #2

https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
April 23, 2013, 10:06:15 AM
 #3


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?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
April 23, 2013, 10:07:23 AM
 #4

Try http://blockchain.info/api
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
April 23, 2013, 12:10:24 PM
 #5


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

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
April 23, 2013, 02:21:26 PM
 #6

Or maybe there is an example, C++, of "check if payment arrived at address" / "send payment to an address"?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
April 23, 2013, 02:29:27 PM
 #7

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
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
April 23, 2013, 02:45:23 PM
 #8

The Java example is a wonderful one Smiley

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?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
daytrader420
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
April 23, 2013, 03:06:11 PM
 #9

The Java example is a wonderful one Smiley

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.

Smiley
daytrader420
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
April 23, 2013, 03:33:49 PM
 #10

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.

Smiley
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
April 24, 2013, 08:11:58 AM
 #11

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 Smiley I know it is a wonderfull library. I just prefer a black box approach.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
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!