Bitcoin Forum
May 04, 2024, 01:42:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: easybitcoin.php  (Read 122 times)
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
October 28, 2022, 08:45:01 PM
Merited by BlackHatCoiner (4), dgoon (2), TryNinja (1), r_victory (1)
 #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
1714830168
Hero Member
*
Offline Offline

Posts: 1714830168

View Profile Personal Message (Offline)

Ignore
1714830168
Reply with quote  #2

1714830168
Report to moderator
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
CounterEntropy
Full Member
***
Offline Offline

Activity: 214
Merit: 277


View Profile
October 28, 2022, 09: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]);
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
October 28, 2022, 09: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
CounterEntropy
Full Member
***
Offline Offline

Activity: 214
Merit: 277


View Profile
October 28, 2022, 10: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] => )
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
October 28, 2022, 10: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
TryNinja
Legendary
*
Offline Offline

Activity: 2828
Merit: 6977



View Profile WWW
October 28, 2022, 10:09:02 PM
Merited by BlackHatCoiner (4), CounterEntropy (1)
 #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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
October 28, 2022, 10: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
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!