Author

Topic: easybitcoin.php (Read 146 times)

member
Activity: 180
Merit: 52
October 28, 2022, 05:18:16 PM
#7
Just do:

Code:
$getinfo['staking array']

Just like if you wanted to display the difficulty or moneysupply:

Code:
$getinfo['difficulty']
$getinfo['moneysupply']

Your page broke because @CounterEntropy's suggestion missed the quotes.

Wow as simple as that, some times you just cant see the wood from the tree's.

Many thanks for your help both of you Smiley

TT
legendary
Activity: 2758
Merit: 6830
October 28, 2022, 05:09:02 PM
#6
Just do:

Code:
$getinfo['staking array']

Just like if you wanted to display the difficulty or moneysupply:

Code:
$getinfo['difficulty']
$getinfo['moneysupply']

Your page broke because @CounterEntropy's suggestion missed the quotes.
member
Activity: 180
Merit: 52
October 28, 2022, 05:06:43 PM
#5
Thanks for taking the time to help me its appreciated, this is the easybitcoin.php code:

https://github.com/aceat64/EasyBitcoin-PHP

I just cant figure it out Sad

Thanks
TT
full member
Activity: 214
Merit: 278
October 28, 2022, 05:01:32 PM
#4
If you can not provide the content of 'easybitcoin.php', provide what you exactly get here...

Code:
Array ( [version] => 1040203 [protocolversion] => 70929 [services] => NETWORK/BLOOM/ [walletversion] => 169900 [balance] => 6000.96068 [zerocoinbalance] => 0 [staking status] => Staking Active [blocks] => 1823565 [timeoffset] => 0 [connections] => 242 [proxy] => [difficulty] => 114235.22515094 [testnet] => [moneysupply] => 1114119657.5589 [keypoololdest] => 1666243740 [keypoolsize] => 99 [paytxfee] => 0 [relayfee] => 0.0001 [errors] => )
member
Activity: 180
Merit: 52
October 28, 2022, 04:47:48 PM
#3
Thanks for the reply, however that didnt work Sad

It broke the page "web address is currently unable to handle this request.

Thanks
TT
full member
Activity: 214
Merit: 278
October 28, 2022, 04:39:55 PM
#2
Could have been easier to debug by knowing the content of 'easybitcoin.php'. Anyways, try this...

Code:
require_once('easybitcoin.php');

$bitcoin = new Bitcoin('user','pass','localhost','port');

$getinfo = $bitcoin->getinfo();

print_r($getinfo[staking status]);
member
Activity: 180
Merit: 52
October 28, 2022, 03:45:01 PM
#1
A nice little handy opensource bit of code........

This seems to work good on calling one response items such as getconnectioncount where just one figure is needed, but I am trying to display on my website single bits of information.

So I am stuck here

Code:
require_once('easybitcoin.php');

$bitcoin = new Bitcoin('user','pass','localhost','port');

$getinfo = $bitcoin->getinfo();

print_r($getinfo);

This of coarse returns something similar to this:

Code:
Array ( [version] => 1040203 [protocolversion] => 70929 [services] => NETWORK/BLOOM/ [walletversion] => 169900 [balance] => 6000.96068 [zerocoinbalance] => 0 [staking status] => Staking Active [blocks] => 1823565 [timeoffset] => 0 [connections] => 242 [proxy] => [difficulty] => 114235.22515094 [testnet] => [moneysupply] => 1114119657.5589 [keypoololdest] => 1666243740 [keypoolsize] => 99 [paytxfee] => 0 [relayfee] => 0.0001 [errors] => )

So my question is what would I alter here to get "staking status" for example:

Code:
$getinfo = $bitcoin->getinfo();

I have tried allsorts such as:

Code:
$getinfo = $bitcoin->getinfo(stakingstatus);
$getinfo = $bitcoin->getinfo->stakingstatus();
$getinfo = $bitcoin->getinfo=>stakingstatus();

But to no avail, so if anyone could point me int the correct direction I woud be very grateful

Thanks
TT
Jump to: