Author

Topic: jsonPRC Client & Server Implementation (Hello World!) (Read 465 times)

member
Activity: 70
Merit: 10
I'm also looking for advise on retrieving the information. Example, i want to post info from bitcoin and post it on a site. Would it be more practical to have my webpage (PHP) pull the information directly and post it on the page? or would it be a better idea to have Python (or even PHP) running in the back-end updating a mySQL database, and the website pull the information from the DB?

Honestly, it doesn't really matter, because no matter where your code is (in the same file as your html, or a separate php file), it is still running on the server.  The only time it really matter is if you plan on implementing AJAX, but seeing as your first JSON-RPC attempt as to ignore the server, and just write "Hello World" onto the screen, I doubt will be wanting to try this at the moment.

When working with JSON-RPC, it's best to just think of it as talking to the bitcoind server though a 3rd-party.  Anything you can do in the terminal with bitcoind (run "bitcoind help" for a list of functions), you can do with JSON-RPC.
Assuming all your working with is bitcoin addresses/accounts, their balances, and sending/receiving transactions, then you have no need for a mySQL table, as all the info is kept with bitcoind.
newbie
Activity: 27
Merit: 0
*** Newbie here - Second Post ***

I kind of dove into the whole bitcoin/p2pool/LAMP thing late last week, so i'm sure i'm in over my head here.

I have read over https://en.bitcoin.it/wiki/PHP_developer_intro and https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) which are great, but don't really provide much info for the complete newbies.

I'm stuck at "Hello World." i followed the instructions. But I would like a little more detail/instruction of proper placement and implementation of the JSON RPC Client and Server. When following the instruction, i get the below response in the browser. [I do change the username/password/port info].

Response i get
Code:
[left][center]require_once 'jsonRPCClient.php'; $bitcoin = new jsonRPCClient('http://user:[email protected]:8332/'); echo "
\n";
  print_r($bitcoin->getinfo());
  echo "
";[/center][/left]
Jump to:
© 2020, Bitcointalksearch.org