Bitcoin Forum
May 10, 2024, 01:31:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Extracting info using RPC  (Read 366 times)
BTC_1 (OP)
Full Member
***
Offline Offline

Activity: 148
Merit: 100



View Profile
December 15, 2016, 07:13:20 PM
 #1

Is it possible to extract specific info from a bitcoin rpc call

Example and im going to use an altcoin as its easier but I guess the same applies to BTC

I use the command "Swingd getmininginfo" and the out put is this:

Code:
"Blocks" : 405319,
    "Current Block Size" : 1000,
    "Current Block Tx" : 0,
    "Difficulty" : {
        "Proof of Work" : 2614987.07498234,
        "Proof of Stake" : 0.03581758,
        "Search Interval" : 1
    },
    "Block Value" : 159500000,
    "Net MH/s" : 72930415.36696009,
    "Net Stake Weight" : 922198.70837217,
    "Errors" : "",
    "Pooled Tx" : 0,
    "Stake Weight" : {
        "Minimum" : 61,
        "Maximum" : 0,
        "Combined" : 61
    },
    "Stake Interest" : 9000000,
    "Testnet" : false


Is it possible to adjust the command "getmininginfo" to display for example Net MH/s or Net Stake Weight instead of all the output ?

I am building a webpage that I want to show weight and net hash but not the rest of the out put

Thanks

1715347908
Hero Member
*
Offline Offline

Posts: 1715347908

View Profile Personal Message (Offline)

Ignore
1715347908
Reply with quote  #2

1715347908
Report to moderator
1715347908
Hero Member
*
Offline Offline

Posts: 1715347908

View Profile Personal Message (Offline)

Ignore
1715347908
Reply with quote  #2

1715347908
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715347908
Hero Member
*
Offline Offline

Posts: 1715347908

View Profile Personal Message (Offline)

Ignore
1715347908
Reply with quote  #2

1715347908
Report to moderator
1715347908
Hero Member
*
Offline Offline

Posts: 1715347908

View Profile Personal Message (Offline)

Ignore
1715347908
Reply with quote  #2

1715347908
Report to moderator
1715347908
Hero Member
*
Offline Offline

Posts: 1715347908

View Profile Personal Message (Offline)

Ignore
1715347908
Reply with quote  #2

1715347908
Report to moderator
achow101
Staff
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
December 15, 2016, 07:15:58 PM
 #2

You can use a JSON library to parse the output (which is in JSON format) and then pull out the parts that you want. Or you can directly modify the source code for the RPC to only give you the info that you want.

BTC_1 (OP)
Full Member
***
Offline Offline

Activity: 148
Merit: 100



View Profile
December 15, 2016, 07:21:02 PM
 #3

You can use a JSON library to parse the output (which is in JSON format) and then pull out the parts that you want. Or you can directly modify the source code for the RPC to only give you the info that you want.

Thanks for the speedy reply.

JSON is out of the question for this project and i have tried various commands such as getnethash etc etc but none work

fikihafana
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
December 16, 2016, 11:21:03 PM
 #4

All you need to do is parsing  json output, and do simple calculation
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!