Bitcoin Forum
November 14, 2024, 07:20:08 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Developing of API  (Read 494 times)
sanoplay (OP)
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!
mocacinno
Legendary
*
Offline Offline

Activity: 3584
Merit: 5243


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
February 12, 2019, 08:39:18 PM
Merited by bones261 (2), ABCbits (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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
sanoplay (OP)
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: 952
Merit: 452


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..

Beep boop beep boop
100bitcoin
Sr. Member
****
Offline Offline

Activity: 860
Merit: 423


View Profile WWW
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
Member
**
Offline Offline

Activity: 140
Merit: 56


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: 3430
Merit: 3080



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: 53
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: 1778
Merit: 764


www.V.systems


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.


   ██████████        ████████████
     ██████████        ██████████
       ██████████        ████████
         ██████████        ██████
           ██████████        ████
             ██████████        ██
               ██████████
                 ██████████
                   ████████
                     ██████
                       ████
                        ██
|
     ▄▀▀▀▀▀▀▀▀▀█                 ▄▀▀▀▀▀▀▀▀▀█
 ▄▀                ▄▀█             ▄▀                ▄▀█
 ██████████    █             ██████████    █
 █                █                   █                █    █
 █                █     ▀▀▀▀▀▀▀█                █    █
 █                █  ▄▀             █                █  ▄▀
 ██████████▀                 ██████████▀
          █                                    █
          █                                    █
     ▄▀ █  ▀▀▀▀█                   ▄▀ █ ▀▀▀▀▀▀█
 ▄▀             ▄▀█               ▄▀               ▄▀ █
 █████████   █               ██████████    █
 █              █   █               █                █    █
 █              █   █               █                █    █
 █              █  ▄▀▀▀▀▀▀▀  █                █  ▄▀
 █████████▀                  ██████████▀

Blockchain
Database
                             ▄▄▄
                         ▄▄▀  ▀▄▄
        ▄           ▄▄▀  ▄▀▄  ▀▄▄
      █▄█   █████████████████    █
        █     █                              █ ▄▀ ▌
        █     █        ▄    █   ▄         █▀ ▄▌
       ██    █      ▀▄   █    ▄▀       █▀█
       ▌ ▌   █            █                █  █
       ▌ ▌   █                              █  █
       ██    ███████████████████
                     ▀▀▄  ▀▄▀  ▄▀▀
                         ▀▀▄  ▄▀▀
                             ▀▀▀
Dev friendly
SDK Platform
                             ▄▄▄▄
                         ▄▄█    █▄▄
                     ▄▄█            █▄▄
                 ▄▄█       ▄▄▄       █▄▄
                 █       ▄▀      ▀▄       █
               █▀     █      █      █     ▀█
               ▀▀█  █   ▄█▀█▄   █  █▀▀
               █▀▀   █  ▀███▀  █   ▀▀█
               ▀▀█     █    █    █     █▀▀
                   ▀▀█   █  █  █   █▀▀
                       ▀████████▀
                           █▄▄▄▄█
                 █        █▄▄▄▄█      █
             ▄▀ █▄                   ▄█  ▀▄
            █   █▀▄         ▀      ▄▀█    █
           █   █  █  ▌      ▀   ▐  █  █    █
           █   █▄▀▄▌      ▀   ▐▄▀▄█    █
           █       █          ▀        █       █
        █▀▀▀▀▀▀█                █▀▀▀▀▀▀█
        ▀▀▀▀▀▀▀▀                ▀▀▀▀▀▀▀▀
User-friendly
Token Creation
|
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!