Author

Topic: Programming Newbie Looking For Some Answers (Read 962 times)

legendary
Activity: 1372
Merit: 1008
1davout
December 26, 2012, 09:07:49 AM
#5
Thanks Davout!
No worries!
With this solution you can mix some websocket magic to instantly push all balance updates to the browser.
That's what Instawallet uses.
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
December 26, 2012, 09:00:27 AM
#4
the website will ping the Bitcoin client every so often
Use the monitortx patch instead, much better.

Thanks Davout!
legendary
Activity: 1372
Merit: 1008
1davout
December 26, 2012, 08:29:12 AM
#3
the website will ping the Bitcoin client every so often
Use the monitortx patch instead, much better.
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
December 26, 2012, 08:20:23 AM
#2
The balances are normally attributed to a user_id that the user can login with and check their balance. When a user would like to deposit an address the website code would query the Bitcoin client through JSON command that will generate an address. The newly generated address will be attributed to the user_id as a deposit address. The user then sends the Bitcoins to the address, and the website will ping the Bitcoin client every so often to see if any new bitcoins have been received, If there are new bitcoins the information can be extract to that particular transaction information like "+1 Bitcoin deposited" type of information. You take that information and increase the users current balance value.

I'm working on a Bitcoin Development Kit library for PHP that facilitates all these kind of convinces, checking new balances is a planned feature but I'm going to make it official and post it on the github "issues" page. (https://github.com/Xenland/Bitcoin-Development-Kit/issues/5)


Update: This feature of updating balances has been added to the to-do list instead
(https://github.com/Xenland/Bitcoin-Development-Kit/wiki/%28%29-To-Do-Features-%28Notes-to-contributing-developers%29)
full member
Activity: 126
Merit: 100
December 26, 2012, 07:53:24 AM
#1
Hey guys, I'm new to programming/scripting
and I'd like to ask,

How do other websites/services do this

Customer on website:
0.00 balance

Website > Generates/Shows Customer a bitcoin address
Customer > Deposits 1.00 to bitcoin address
Website > receives bitcoins and automatically changes customer's stats:

Customer on website:
1.00 balance


Is it possible to have an example and an explanation to it too?
thanks.
Jump to: