简体   繁体   中英

Developing of blockchain API

I need your help, I'm trying to create an API. With the help of this API I would like to get statistics for the last 24 hours of Bitcoin network and return something like that:

  • Amount of mined blocks
  • Amount of transactions
  • Hashrate

and so on.

Can you suggest how I can access this data without using others' APIs?

If you are running a node you should be able to get the needed information through the rpc interface. How, would be more implementation specific. You would need to for example store the block height somewhere, and 24 hours later subtract that from the current.

If you are not running a node, you would need to write code to connect directly to the network and find peers to get the information from, maybe using something link bcoin.Peer or equivalent for your language of choice and handle relevant messages as they come in, or roll your own following the protocol

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM