Bitcoin Forum
May 09, 2024, 07:51:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Get amount of blocks found last hour  (Read 953 times)
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
May 17, 2015, 08:03:48 PM
 #1

I am looking for a simple way to count the number of blocks found in the bitcoin network during the last hour at any given time.

What I can think of is to "getinfo" extract block and insert time, and block number in a Sql, this could be done once every hour and do a php calc, but is there a more simple way to do this?
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715284319
Hero Member
*
Offline Offline

Posts: 1715284319

View Profile Personal Message (Offline)

Ignore
1715284319
Reply with quote  #2

1715284319
Report to moderator
1715284319
Hero Member
*
Offline Offline

Posts: 1715284319

View Profile Personal Message (Offline)

Ignore
1715284319
Reply with quote  #2

1715284319
Report to moderator
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
May 17, 2015, 08:10:05 PM
 #2

As a followup question regarding the getinfo and jsonrpc can I extract the blocks information like this, or how should this be done?

$btcinfo = $bitcoin->getinfo->blocks;
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
May 17, 2015, 10:57:18 PM
 #3

I am looking for a simple way to count the number of blocks found in the bitcoin network during the last hour at any given time.

What I can think of is to "getinfo" extract block and insert time, and block number in a Sql, this could be done once every hour and do a php calc, but is there a more simple way to do this?

You can't know for certain how many blocks have been found in the past hour, or when any particular block was found.

Blocks do have a timestamp, but miners are allowed to fill that timestamp with a time in the near past or near future when building the block.  Therefore, that timestamp is only accurate to a time within a few hours.

The only other reliable time you have is the time that your wallet first hears about a block from a peer.  There is a possibility of a delay between when the block is solved and when your wallet first hears about the block.
hexafraction
Sr. Member
****
Offline Offline

Activity: 392
Merit: 259

Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ


View Profile
May 18, 2015, 12:10:32 AM
 #4

I am looking for a simple way to count the number of blocks found in the bitcoin network during the last hour at any given time.

What I can think of is to "getinfo" extract block and insert time, and block number in a Sql, this could be done once every hour and do a php calc, but is there a more simple way to do this?

You can't know for certain how many blocks have been found in the past hour, or when any particular block was found.

Blocks do have a timestamp, but miners are allowed to fill that timestamp with a time in the near past or near future when building the block.  Therefore, that timestamp is only accurate to a time within a few hours.

The only other reliable time you have is the time that your wallet first hears about a block from a peer.  There is a possibility of a delay between when the block is solved and when your wallet first hears about the block.

For a well-connected peer this should only be off by a few seconds, no?

I have recently become active again after a long period of inactivity. Cryptographic proof that my account has not been compromised is available.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
May 18, 2015, 12:36:42 AM
 #5

I am looking for a simple way to count the number of blocks found in the bitcoin network during the last hour at any given time.

What I can think of is to "getinfo" extract block and insert time, and block number in a Sql, this could be done once every hour and do a php calc, but is there a more simple way to do this?

You can't know for certain how many blocks have been found in the past hour, or when any particular block was found.

Blocks do have a timestamp, but miners are allowed to fill that timestamp with a time in the near past or near future when building the block.  Therefore, that timestamp is only accurate to a time within a few hours.

The only other reliable time you have is the time that your wallet first hears about a block from a peer.  There is a possibility of a delay between when the block is solved and when your wallet first hears about the block.

For a well-connected peer this should only be off by a few seconds, no?

Generally?  Sure.

It all depends on your use case and how specifically you wish to know the number of blocks found in the last hour.

If your node should loose connectivity for a few hours any reason, then all those blocks would appear to have occurred in the same few minutes when connectivity returns.  There could be other reasons that you don't hear about a block right away as well (for instance forks and orphan blocks).



AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
May 18, 2015, 05:36:25 AM
 #6

On Blockcahin.info I see this realtime "block found" list, and a history of found blocks as well. This information I assume is a db solution which is updated with every block that is found?

Do you know if an API is available for this list?
hexafraction
Sr. Member
****
Offline Offline

Activity: 392
Merit: 259

Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ


View Profile
May 18, 2015, 09:48:55 AM
 #7

Yes, there is one. Just click the link labeled API on the blockchain.info homepage  Smiley

I have recently become active again after a long period of inactivity. Cryptographic proof that my account has not been compromised is available.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
May 18, 2015, 10:15:51 AM
 #8

On Blockcahin.info I see this realtime "block found" list, and a history of found blocks as well. This information I assume is a db solution which is updated with every block that is found?

Do you know if an API is available for this list?

Just keep in mind that this is a list is updated when blockchain.info's peer nodes first hear about a block, and not when they are actually found.  Under normal circumstances the delay between when a block is found and when blockchain.info hears about it is very small (probably less than a second).  However, there can be circumstances (and have been in the past) when blockchain.info may not report a found block for several minutes or even a few hours.
Nextgen
Sr. Member
****
Offline Offline

Activity: 410
Merit: 250


View Profile
May 20, 2015, 04:38:16 PM
 #9

I am New!!!! Please help me how to earn bitcoins!!!
So please helpp meeeeeeeeee!!!!!!!
go there and read the posts
https://bitcointalk.org/index.php?board=39.0

a good place to start from for newbies
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!