Better comunication with Bitcoinity's websocket
I think I have to send 3 messages to the websocket to initialise it. In response, it seems to send the last ticker price reasonably quickly, compared to earlier when it was just waiting for the next available transaction before notifying me.
This commit is contained in:
parent
2016f19c3d
commit
d80908da4e
10 changed files with 436 additions and 62 deletions
20
docs/sample_communication.txt
Normal file
20
docs/sample_communication.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
SEND >> {"topic":"all","event":"phx_join","payload":{},"ref":"1"}
|
||||
RECV << {"event":"phx_reply","payload":{"response":{},"status":"ok"},"ref":"1","topic":"all"}
|
||||
SEND >> {"topic":"webs:markets","event":"phx_join","payload":{},"ref":"2"}
|
||||
RECV << {"event":"phx_reply","payload":{"response":{},"status":"ok"},"ref":"2","topic":"webs:markets"}
|
||||
SEND >> {"topic":"webs:markets_kraken_USD","event":"phx_join","payload":{},"ref":"3"}
|
||||
RECV << {"event":"phx_reply","payload":{"response":{},"status":"ok"},"ref":"3","topic":"webs:markets_kraken_USD"}
|
||||
RECV << {"event":"new_msg","payload":{"data":{"currency":"USD","exchange_name":"bitfinex","last":29420.94784483}},"ref":null,"topic":"webs:markets"}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
SEND >> {"topic":"all","event":"phx_join","payload":{},"ref":"1"}
|
||||
RECV << {"event":"phx_reply","payload":{"response":{},"status":"ok"},"ref":"1","topic":"all"}
|
||||
SEND >> {"topic":"webs:markets","event":"phx_join","payload":{},"ref":"2"}
|
||||
RECV << {"event":"phx_reply","payload":{"response":{},"status":"ok"},"ref":"2","topic":"webs:markets"}
|
||||
SEND >> {"topic":"webs:markets_kraken_USD","event":"phx_join","payload":{},"ref":"3"}
|
||||
RECV << {"event":"phx_reply","payload":{"response":{},"status":"ok"},"ref":"3","topic":"webs:markets_kraken_USD"}
|
||||
RECV << {"event":"new_msg","payload":{"data":{"connected_count":1355}},"ref":null,"topic":"webs:markets"}
|
||||
RECV << {"event":"new_msg","payload":{"data":{"currency":"EUR","exchange_name":"paymium","last":28363.44}},"ref":null,"topic":"webs:markets"}
|
1798
docs/sample_responses.json
Normal file
1798
docs/sample_responses.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue