Bitcoin Forum
May 22, 2019, 12:23:56 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Developing of API  (Read 371 times)
sanoplay
Newbie
*
Offline Offline

Activity: 6
Merit: 1


View Profile
February 12, 2019, 08:35:48 PM
Last edit: February 12, 2019, 08:46:52 PM by sanoplay
Merited by bones261 (1)
 #1

Hello guys, i need your help.
I'm trying to create an API. With 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 me, how i can access this data without using others APIs?

Thanks

GL and have a good day, guys!
1558527836
Hero Member
*
Offline Offline

Posts: 1558527836

View Profile Personal Message (Offline)

Ignore
1558527836
Reply with quote  #2

1558527836
Report to moderator
1558527836
Hero Member
*
Offline Offline

Posts: 1558527836

View Profile Personal Message (Offline)

Ignore
1558527836
Reply with quote  #2

1558527836
Report to moderator
Be very wary of relying on JavaScript for security on sites such as blockchain.info and brainwallet.org. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1558527836
Hero Member
*
Offline Offline

Posts: 1558527836

View Profile Personal Message (Offline)

Ignore
1558527836
Reply with quote  #2

1558527836
Report to moderator
mocacinno
Legendary
*
Online Online

Activity: 1596
Merit: 1584


https://unblur.ninja =>lightning network testsite


View Profile WWW
February 12, 2019, 08:39:18 PM
Merited by bones261 (2), ETFbitcoin (1)
 #2

If you want a quick and easy sollution, check out https://bitcore.io

If you want to do it yourself, you'll have to run a full node and either use the json-rpc interface and build a custom api on top of it, or build a block parser, extract the needed data and build an api on top of this data

sanoplay
Newbie
*
Offline Offline

Activity: 6
Merit: 1


View Profile
February 13, 2019, 05:59:27 PM
 #3

Thank you!
I'll explore and try.

GL
KingZee
Sr. Member
****
Offline Offline

Activity: 574
Merit: 413


Check your coin privilege


View Profile
February 14, 2019, 05:25:29 AM
 #4

Thank you!
I'll explore and try.

GL

Why don't you want to use an external API?

There are a lot of great solutions out there, even for free. I would recommend chain.so, they have the best realtime socket setup, and you can subscribe to events like mew blocks, or new mempool txes.

Parsing blocks and txes yourself from the full node is a total pain in the ass, while it would be a great idea if you're looking to learn, it's a waste of time if you have some business end-goal from this..

100bitcoin
Sr. Member
****
Offline Offline

Activity: 545
Merit: 267


View Profile
February 16, 2019, 08:35:20 PM
 #5

Thank you!
I'll explore and try.

GL

Why don't you want to use an external API?

There are a lot of great solutions out there, even for free. I would recommend chain.so, they have the best realtime socket setup, and you can subscribe to events like mew blocks, or new mempool txes.

Parsing blocks and txes yourself from the full node is a total pain in the ass, while it would be a great idea if you're looking to learn, it's a waste of time if you have some business end-goal from this..

Sometimes, running a full node, is a cost overhead.

c_atlas
Jr. Member
*
Offline Offline

Activity: 42
Merit: 6


View Profile
February 17, 2019, 06:23:44 PM
 #6

Why don't you want to use an external API?
Could be they want to verify everything themselves and not trust another node. If that's the case they could just aggregate the stats from multiple APIs and avg it out while keeping an eye out for outliers. Probably still easier than running a full node and you've got a bit more assurance.
Carlton Banks
Legendary
*
Offline Offline

Activity: 2380
Merit: 1671



View Profile
February 17, 2019, 08:05:54 PM
 #7

If you want a quick and easy sollution, check out https://bitcore.io

that software should come with a health warning...


From the bitcore.io front page:

Quote
Bitcore uses the source code of Bitcoin directly, so accidental chain forks are a thing of the past.

Right, except when Bitpay change the underlying source code to switch you to a different chain fork, deliberately. At least Bitpay tell you they do this kind of thing, they tell you "bad things will happen" if you don't use the software that uses the chain fork they think you should use.


Unless you want to constantly check how Bitpay are imposing their self-interest on the code you run, you're better off choosing a solution that you can rely on permanently. Or fork their API and patch it into the Bitcoin source code, then you can be compatible with the API and use trustworthy source for the bitcoin network (assuming the API does the job you want)

Vires in numeris
CreateCryptoCo.in
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
February 19, 2019, 12:00:50 AM
 #8

best would be to talk directly to bitcoind, throw the rpc interface, just send some json and parse it.

In that way you will not really need to rely to much on any third party(often they come and go).
You might want to have like 2 urls that you get the current block from for checking that your node is up to date.

Alot of blockexplorers work like this, and you will both learn more and offer a better service that you can scale, The down side is that you will have to allocate like 300/250 gb of diskspace for the bitcoins blockchain
legendster
Hero Member
*****
Offline Offline

Activity: 1162
Merit: 633



View Profile
February 27, 2019, 09:21:18 PM
 #9

Hi OP, I know you don't want to use external API's but you can rely on insight
They're open source so you can probably modify and redeploy according to your own needs. This is, of course, if you're sticking to commercial or personal uses and not something proprietary.

█▀▀█
██▄█
BESTMIXER.IO // BEST BITCOIN MIXER
█▀▀█
██▄█
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!