Just wrote a tiny debug/info script based on the class found here:
https://bitcointalksearch.org/topic/bitcoin-php-open-source-9304
Its basically just a script witch shows this in your web browser, for example:
Bitcoin Version: 70100
Protocol Version: 60002
Wallet Version: 10500
Blocks: 168375
Connections: 2
Difficulty: 1376302.2678864
Peer Nr: 1
IP:Port: 123.123.123.123:8333
Version: 32400
Peer Nr: 2
IP:Port: 456.456.456.456:8333
Version: 60001
Subversion : Satoshi:0.6.2
The source is here:
include_once("bitcoin.php");
$rpcUser = "rpcuser";
$rpcPass = "rpcpass";
$url = "http://127.0.0.1:8332";
// create bitcoin object
$bitcoin = new Bitcoin($url, $rpcUser, $rpcPass);
/**
* Refer to https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
* for a list of methods
*/
/////////////////////////////////////
// Local Wallet Balance
$Balance = $bitcoin->getBalance();
echo("
Balance: $Balance");
/////////////////////////////////////
// Bitcoin Info
$info = $bitcoin->getinfo();
//
// What is our bitcoin version?
echo("
Bitcoin Version: ");
print_r ($info["version"]);
// What is the protocol version?
echo("
Protocol Version: ");
print_r ($info["protocolversion"]);
// What is the version of the wallet file?
echo("
Wallet Version: ");
print_r ($info["walletversion"]);
// How many blocks have we downloaded?
echo("
Blocks: ");
print_r ($info["blocks"]);
// How many connections to the bitcoin network do we have?
echo("
Connections: ");
print_r ($info["connections"]);
// What is the network difficulty?
echo("
Difficulty: ");
print_r ($info["difficulty"]);
// If no errors, why would we show it?
if ($info["errors"] !== ""){
echo("
Errors: ");
print_r ($info["errors"]);
echo "
";
}else{
echo "
";
}
/////////////////////////////////////
// Peer Info
$peerinfo = $bitcoin->getPeerInfo();
//
// Count the connections, so we know how many peers to show on the page.
for( $count=0; $count<=$info["connections"]; $count++ ){
$counter = $count - 1;
// Wich peer are we showing?
if ($count > 0){
$peerData = $peerinfo["$counter"];
echo("Peer Nr: $count ");
// What is his ip?
echo "
IP:Port: ";
print_r($peerData["addr"]);
// Wich version does he uses?
echo "
Version: ";
print_r($peerData["version"]);
// Does he use a mainstream or a subversion?
// If no subversion, i dont care!
if ($peerData["subver"] !== ""){
echo "
Subversion : ";
// Remove those dirty "/"'s from the subversion info.
$SubVerUC = $peerData["subver"];
$SubVerRP = "/";
$SubVersion = str_replace($SubVerRP, "", $SubVerUC);
// Print the cleaned subversion info.
print_r($SubVersion);
}
// If the peer has no banscore, do not alert me!
if ($peerData["banscore"] != "0"){
echo "
Banscore: ";
print_r($peerData["banscore"]);
}
echo "
";
}
}
?>
Please be aware that the use of this script could be a big security issue!
Do not use this script from insecure connections, nor use this on a production server before you implement some sort of security in it!
Preferable use this only on a new server, just to make sure everything is working, when everything is working, just delete the file from the server.
If someone finds it useful... Enjoy!
MasterX