Bitcoin Forum
November 09, 2024, 02:47:48 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Php Script  (Read 637 times)
CoreQ (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
April 22, 2014, 03:08:41 PM
 #1

Does anyone have any php script /or what command to call that can get all incoming transactions using the rpc daemon? Thank you.
ksteve96
Full Member
***
Offline Offline

Activity: 624
Merit: 125


alcedoplatform.com


View Profile WWW
April 22, 2014, 10:55:01 PM
 #2

getreceivedbyaccount    [account] [minconf=1]
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list#Full_list

  𝗔𝗟𝗖𝗘𝗗𝗢  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬   Making Cryptocurrencies Accessible For Everyone!         Made in
██████████████████████████████████████████       GERMANY
     𝗔𝗡𝗡     𝗪𝗵𝗶𝘁𝗲𝗽𝗮𝗽𝗲𝗿     𝗙𝗮𝗰𝗲𝗯𝗼𝗼𝗸     𝗧𝘄𝗶𝘁𝘁𝗲𝗿     𝗠𝗲𝗱𝗶𝘂𝗺     𝗕𝗼𝘂𝗻𝘁𝘆     𝗧𝗲𝗹𝗲𝗴𝗿𝗮𝗺              🇩🇪 🇩🇪 🇩🇪
CoreQ (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
April 22, 2014, 11:26:06 PM
 #3


I saw the API calls list but I dont know how to call it. for example getting the balance works

$bitcoin = new jsonRPCClient('http://test:test123@127.0.0.1:8332/');
$total = $bitcoin->getbalance();
echo "balance = $total";

If I call 'getinfo'

 $get = $bitcoin->getinfo();
 echo "Getinfo result: $get";


Notice: Array to string conversion in C:\xampp\htdocs\show balance\test.php on line 18
Getinfo result: Array
zeflex
Full Member
***
Offline Offline

Activity: 180
Merit: 100


View Profile
April 22, 2014, 11:45:41 PM
 #4


 echo "Getinfo result: $get";


Notice: Array to string conversion in C:\xampp\htdocs\show balance\test.php on line 18
Getinfo result: Array

You can't echo something if it's not an integer or a string.

Use
Code:
var_dump($get);
instead

ksteve96
Full Member
***
Offline Offline

Activity: 624
Merit: 125


alcedoplatform.com


View Profile WWW
April 23, 2014, 12:01:01 AM
 #5

what is on line 18? I don't see anything like $getinfo[]
 
Try making your title more specific too, probably nobody even reading this.  


  𝗔𝗟𝗖𝗘𝗗𝗢  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬   Making Cryptocurrencies Accessible For Everyone!         Made in
██████████████████████████████████████████       GERMANY
     𝗔𝗡𝗡     𝗪𝗵𝗶𝘁𝗲𝗽𝗮𝗽𝗲𝗿     𝗙𝗮𝗰𝗲𝗯𝗼𝗼𝗸     𝗧𝘄𝗶𝘁𝘁𝗲𝗿     𝗠𝗲𝗱𝗶𝘂𝗺     𝗕𝗼𝘂𝗻𝘁𝘆     𝗧𝗲𝗹𝗲𝗴𝗿𝗮𝗺              🇩🇪 🇩🇪 🇩🇪
CoreQ (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
April 23, 2014, 12:06:28 AM
 #6


 echo "Getinfo result: $get";


Notice: Array to string conversion in C:\xampp\htdocs\show balance\test.php on line 18
Getinfo result: Array

You can't echo something if it's not an integer or a string.

Use
Code:
var_dump($get);
instead




Great now is working. Thank you.


what is on line 18? I don't see anything like $getinfo[]
 
Try making your title more specific too, probably nobody even reading this.  



Got the help I needed Smiley
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
April 24, 2014, 10:54:34 AM
 #7

Just to explain what's actually happening here: When you run a bitcoind command (not RPC yet), you are technically seeing the response in JSON.

When you're submitting using the jsonRPCclient, it takes care of dealing with the intermediary JSON for you. When you're playing with the createrawtransaction RPC call, you're not passing json strings as parameters, you pass arrays. The library takes care of converting to JSON, and decoding the response.

Hence, many RPC commands are expected to return an array (although not all)

Bitwasp Developer.
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!