Bitcoin Forum
April 18, 2024, 11:18:55 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Websocket Server/API  (Read 1525 times)
asoltys (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
May 10, 2014, 03:20:42 AM
 #1

I've found https://blockchain.info/api/api_websocket really handy for watching addresses and transactions in realtime web apps with javascript.  I tried to ask blockchain.info if the implementation of this API is open source somewhere and didn't get a response.  I don't see it on their github page.  Does anyone know how this is implemented or if there are any open source alternatives that I could host myself?  Any ideas what technologies might be used to create an API like this?  socket.io? bitcoind or bitcoinj?
1713439135
Hero Member
*
Offline Offline

Posts: 1713439135

View Profile Personal Message (Offline)

Ignore
1713439135
Reply with quote  #2

1713439135
Report to moderator
1713439135
Hero Member
*
Offline Offline

Posts: 1713439135

View Profile Personal Message (Offline)

Ignore
1713439135
Reply with quote  #2

1713439135
Report to moderator
1713439135
Hero Member
*
Offline Offline

Posts: 1713439135

View Profile Personal Message (Offline)

Ignore
1713439135
Reply with quote  #2

1713439135
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713439135
Hero Member
*
Offline Offline

Posts: 1713439135

View Profile Personal Message (Offline)

Ignore
1713439135
Reply with quote  #2

1713439135
Report to moderator
1713439135
Hero Member
*
Offline Offline

Posts: 1713439135

View Profile Personal Message (Offline)

Ignore
1713439135
Reply with quote  #2

1713439135
Report to moderator
1713439135
Hero Member
*
Offline Offline

Posts: 1713439135

View Profile Personal Message (Offline)

Ignore
1713439135
Reply with quote  #2

1713439135
Report to moderator
General
Member
**
Offline Offline

Activity: 106
Merit: 10


View Profile
May 10, 2014, 05:56:11 AM
 #2

Interesting.  Hadn't known about this functionality.

Looked over the API docs. and didn't see anything about it there.

If they still don't respond I'd assume there isn't an API for it.

mriou
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
May 12, 2014, 06:02:04 PM
 #3

You can find something similar here:

http://dev.blockcypher.com/#websockets

Those are mostly private APIs but Websockets aren't hard to put in place. You can use socket.io as you mentioned for the websocket server, the difficulty is more getting access to the original event, which won't be websocket.
davec
Newbie
*
Offline Offline

Activity: 39
Merit: 0


View Profile
May 12, 2014, 06:36:37 PM
 #4

It obviously largely depends on your application, but btcd (an alternative bitcoin core implementation) natively provides support for Websockets and has an extension API that offers exactly this type of capability.  See the btcd JSON-RPC API wiki for the available Websocket extension methods and notifications.

There is sample node.js code on the linked wiki, and it works fine from Javascript through a broswer too.

Along the same lines, if you're willing to use Go for your application, there is a robust package, btcrpcclient which supports Websockets and the btcd extensions to make it easy to create a robust RPC client that automatically maintains the Websocket connection including auto-reconnect capability should the connection be interrupted for some reason and many other features.
biteasy
Newbie
*
Offline Offline

Activity: 55
Merit: 0


View Profile WWW
May 14, 2014, 01:03:26 PM
 #5

You can also try our own Websockets API as well, although is not open source:
https://support.biteasy.com/kb/websockets-api
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!