Bitcoin Forum
September 22, 2018, 12:17:50 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How can i calculate the average blocks per a day by just data from rpc commands  (Read 18 times)
mrmetech
Member
**
Offline Offline

Activity: 180
Merit: 10


View Profile WWW
August 25, 2018, 03:36:22 AM
 #1

How can i calculate the average blocks per a day by just data from rpc commands. I would also like to calculate the average time per a block this way as well any idea ?

Am having trouble finding fast ways to do this or a way at all. If you want to do this there must be a good way. And for coins that aren't just btc


I redid the post here as i did it in mining by accident

1537618670
Hero Member
*
Offline Offline

Posts: 1537618670

View Profile Personal Message (Offline)

Ignore
1537618670
Reply with quote  #2

1537618670
Report to moderator
1537618670
Hero Member
*
Offline Offline

Posts: 1537618670

View Profile Personal Message (Offline)

Ignore
1537618670
Reply with quote  #2

1537618670
Report to moderator
1537618670
Hero Member
*
Offline Offline

Posts: 1537618670

View Profile Personal Message (Offline)

Ignore
1537618670
Reply with quote  #2

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

Posts: 1537618670

View Profile Personal Message (Offline)

Ignore
1537618670
Reply with quote  #2

1537618670
Report to moderator
1537618670
Hero Member
*
Offline Offline

Posts: 1537618670

View Profile Personal Message (Offline)

Ignore
1537618670
Reply with quote  #2

1537618670
Report to moderator
1537618670
Hero Member
*
Offline Offline

Posts: 1537618670

View Profile Personal Message (Offline)

Ignore
1537618670
Reply with quote  #2

1537618670
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 1400
Merit: 1159


Buy bitcoin they said... who listened?


View Profile
August 25, 2018, 04:10:26 AM
 #2

possible solutions since i don't have a way to check it:
use getblockhash[1] command which will give you the has of the block header you want. you already know there are about 144 ( 24 hr * 60 min * 1 block /10 min) per day so get 144 block headers at first and then if you figured there were more within 24 hour then get 145th, 146th ,...

how you figure it out?
in each block header there is a field called block time[2] which is a unix timestamp which is set by the miner. it is most probably an accurate number but it  doesn't have to. use this timestamp to figure out how many blocks were mined in a certain time frame.

[1] https://bitcoin.org/en/developer-reference#getblockhash
[2] https://bitcoin.org/en/developer-reference#block-headers

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!