Comments (12)
Hmmm. Weird. I only have one for 1m candle, one for trades, and one for depth. I do initialize all three at once, but that seems like it shouldn't be too many...
from node-binance-api.
Hi guys, great API, thank you. Has definitely saved me a lot of time getting my project off the ground.
I recently ran into this 504 issue with the WebSocket streams, and realised the API doesn't take advantage of Binance's APIs combined stream endpoints. I've implemented their use in the following commit https://github.com/keith1024/node-binance-api/commit/aeb0d87c4ed5998ae7dd72fb35f47baf8319b9fe
This took me down from ~315 socket connections to 4 for the same amount of data, and eliminated all traces of the "unexpected response" errors. Check it out, let me know what you think. I'll open a PR if you're happy with it.
from node-binance-api.
@Keith1024 Yes, absolutely. I didn't know you could even do this, and it looks fantastic
I'll need to know if there are any breaking changes. If there are, we should increase the version number
Please issue pull requests to the development branch located at:
https://github.com/jaggedsoft/node-binance-api/ and they will be merged into binance-exchange shortly after. Full credit will be given. Thank you!
from node-binance-api.
@jaggedsoft Haha, I know what you mean, I also somehow missed the mention of combined streams in the docs until today. Excellent, I'll submit the PR first thing in the morning. I'd do it now, but it's 01h10 here at the moment and my brain is basically in bed already. No breaking changes, but will confirm in the PR.
from node-binance-api.
This commonly happens when you are trying to open too many websocket connections at once
Or if you are connected to many sockets and get disconnected, it tries to reconnect to them too fast
Both of these issues will be fixed automatically in a future release
from node-binance-api.
Hi there,
Is there a way to catch this error insted of making the app crash until this is fixed?
from node-binance-api.
Can you tell me if you are opening many websocket connections at once?
Does it show they are reconnecting when this happens?
from node-binance-api.
I have about 50 trades webconnections open, and the same amount of candlesticks open.
I try to open both of them with a delay (60sec) to help prevent this.
It will work for sometime, then simply crash with the same error.
Sometime I get an "WebSocket reconnecting:" message before crashing, but not always, and a lots of time, I'll get a "WebSocket reconnecting:" message and it will not crash.
I know the best solution would be as you said on the other github to have a delay on everything, but the official doc tell us that the status is unknown, so maybe we could just ignore it (display a message, or send a error message), and like nothing happend.
from node-binance-api.
Situations like chazzmoney's are the one I'm more concerned about. The automatic reconnection for 50+ websockets should be an easy fix.
Properly handling a 504 error appears to be easier said than done. Looking in to this
from node-binance-api.
@chazzmoney I believe keith1024 has solved this issue and improved the performance of this API overall drastically. Can you confirm?
from node-binance-api.
I've been running it for a couple hours and it seems to work well. I feel like the performance is slower, but I have no basis for that beyond the scroll speed on my terminal.
To fully verify that the problem does not occur again, I'll need to update my cloud server and then check the logs over the next few days. I'll call it good for now and if there is an additional problem I will re-open.
from node-binance-api.
Hello there .. Really I don't understand how we can catch ERRORS :(
I have no so much experience node.js too . I try this try-catch blocks , but Im getting 5045 somethings errors and cutting down process . I need to keep connection 24 hours .... if crash need re-connect self or script should work , not stooped . Anybody help me ?
Thank you ....
try{
}
catch(err){
}
from node-binance-api.
Related Issues (20)
- specify commission asset
- Reqest futuresHistoricalTrades and get status code: 401 Unauthorized HOT 1
- request historicalTrades and got status 401 Unauthorized
- Subscribe to several user streams with one websocket connection
- is there some API to simply convert e.g. USDT to BTC HOT 1
- Problem with await when getting balances HOT 3
- call return price of a symbol
- variable of binance.websockets.bookTickers
- Lack support for Binance mining pool. label:feature-request
- Close futures positions
- Withdraw error not documented -4009
- quoteOrderQty request sometimes not working on 100% buy market
- Custom indicators with websockets
- Timestamp for this request is outside of the recvWindow.
- binance.websockets.trades()
- how to know the change of status of an order?
- support for userFutureData HOT 1
- Support for avgPrice of VESUSDT/VESBUSD/VESUSDC/VESETH/VESBTC HOT 1
- Method to retrieve cross / isolated margin pairs
- Binance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-binance-api.