Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Exchanges not showing up #105

Open
lumir-sliva opened this issue Jul 9, 2020 · 14 comments
Open

Exchanges not showing up #105

lumir-sliva opened this issue Jul 9, 2020 · 14 comments

Comments

@lumir-sliva
Copy link

lumir-sliva commented Jul 9, 2020

I have exchanges not showing up only one from remote clients. If I try locally it's fine, I opened up the dev tools in firefox and network's showing bunch of connection to api's when I connect locally. From remote client there's only 1 connections.. Everything else works.
Debian 10.2 (Docker)

@Tucsky
Copy link
Owner

Tucsky commented Jul 10, 2020

Proxy settings maybe, when starting the client in dev mode (npm run serve) webpack starts a proxy server that should allow you to fetch the latest products from exchanges. Open the console tab of chrome and you should see if it can reach exchanges api. If not, maybe the proxyurl is wrong (default is 8080 but you can have another app on your pc that use it) so the significanttrades app run on 8081, you need to change proxyurl to use 8081 as well.
Right there :https://github.com/Tucsky/SignificantTrades/blob/master/.env

@elxhi
Copy link

elxhi commented Jan 23, 2021

Hi
I have deployed it on Netlify but it fails to fetch data on other exchanges, only Bybit shows up.

From the browser debug console, I noticed this error; net::ERR_CONNECTION_REFUSED.

As you suggested, I have already changed the proxy URL port on .env file, but no way.
Any idea what's wrong with Netlify?

@Schneider3000
Copy link

Schneider3000 commented Jan 26, 2021

I have the same issue. Ive tried setting this up on Digitalocean, both on Apache and Nginx, the same issue persists where only ByBit shows up. Did you ever find a fix?

@Schneider3000
Copy link

These are the errors I get in console:

[bitmex] products data expired
exchange.js:78 [bitfinex] products data expired
exchange.js:78 [binance] products data expired
exchange.js:78 [binance_futures] products data expired
exchange.js:78 [bitstamp] products data expired
exchange.js:78 [gdax] products data expired
exchange.js:78 [poloniex] products data expired
exchange.js:78 [kraken] products data expired
exchange.js:78 [okex] products data expired
exchange.js:78 [deribit] products data expired
exchange.js:78 [huobi] products data expired
exchange.js:78 [hitbtc] products data expired
exchange.js:78 [bybit] products data expired
exchange.js:78 [ftx] products data expired
socket.js:275 [sockets] initializing 14 exchange(s)
Chart.vue:156 [chart.mounted]
chartController.js:58 [chart/controller] create chart
chartController.js:632 [chart/controller] setup queue (500ms)
Chart.vue:570 [chart] setup keepalive
Chart.vue:214 [chart] fetch (real time range)
socket.js:344 [socket.connect] disconnect exchanges asynchronously
socket.js:300 [socket.connect] connecting to BTCUSD
exchange.js:265 [bitmex] fetching products... Array(1)
exchange.js:265 [bitfinex] fetching products... Array(1)
exchange.js:265 [binance] fetching products... Array(1)
exchange.js:265 [binance_futures] fetching products... Array(1)
exchange.js:265 [bitstamp] fetching products... Array(1)
exchange.js:265 [gdax] fetching products... Array(1)
exchange.js:265 [poloniex] fetching products... Array(1)
exchange.js:265 [kraken] fetching products... Array(1)
exchange.js:265 [okex] fetching products... Array(3)
exchange.js:265 [deribit] fetching products... Array(1)
exchange.js:265 [huobi] fetching products... Array(3)
exchange.js:265 [hitbtc] fetching products... Array(1)
exchange.js:265 [ftx] fetching products... Array(1)
test.com/:1 Tracking Prevention blocked a Script resource from loading https://www.google-analytics.com/analytics.js.
www.google-analytics.com/analytics.js:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
index.js:30 Object "save.."
Chart.vue:268 undefined
(anonymous) @ Chart.vue:268
localhost:3002/BTCUSD/historical/1611660560000/1611665880167/10000:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
localhost:8081/https://www.bitmex.com/api/v1/instrument/active:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [bitmex] received API products response => format products
exchange.js:210 [bitmex] unknown pair BTCUSD
localhost:8081/https://api.bitfinex.com/v1/symbols:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [bitfinex] received API products response => format products
exchange.js:210 [bitfinex] unknown pair BTCUSD
localhost:8081/https://api.binance.com/api/v1/ticker/allPrices:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [binance] received API products response => format products
exchange.js:210 [binance] unknown pair BTCUSD
localhost:8081/https://fapi.binance.com/fapi/v1/exchangeInfo:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [binance_futures] received API products response => format products
exchange.js:210 [binance_futures] unknown pair BTCUSD
localhost:8081/https://www.bitstamp.net/api/v2/trading-pairs-info/:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [bitstamp] received API products response => format products
exchange.js:210 [bitstamp] unknown pair BTCUSD
localhost:8081/https://api.pro.coinbase.com/products:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [gdax] received API products response => format products
exchange.js:210 [gdax] unknown pair BTCUSD
index.js:30 Object "save.."
localhost:8081/https://www.poloniex.com/public?command=returnTicker:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [poloniex] received API products response => format products
exchange.js:210 [poloniex] unknown pair BTCUSD
localhost:8081/https://api.kraken.com/0/public/AssetPairs:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [kraken] received API products response => format products
exchange.js:210 [kraken] unknown pair BTCUSD
localhost:8081/https://www.okex.com/api/spot/v3/instruments:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
localhost:8081/https://www.okex.com/api/swap/v3/instruments:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
localhost:8081/https://www.okex.com/api/futures/v3/instruments:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [okex] received API products response => format products
exchange.js:210 [okex] unknown pair BTCUSD
localhost:8081/https://www.deribit.com/api/v1/public/getinstruments:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [deribit] received API products response => format products
exchange.js:210 [deribit] unknown pair BTCUSD
index.js:30 Object "save.."
localhost:8081/https://api.huobi.pro/v1/common/symbols:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
localhost:8081/https://api.hbdm.com/api/v1/contract_contract_info:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
localhost:8081/https://api.hbdm.com/swap-api/v1/swap_contract_info:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [huobi] received API products response => format products
exchange.js:210 [huobi] unknown pair BTCUSD
localhost:8081/https://api.hitbtc.com/api/2/public/symbol:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [hitbtc] received API products response => format products
exchange.js:210 [hitbtc] unknown pair BTCUSD
localhost:8081/https://ftx.com/api/markets:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
exchange.js:283 TypeError: Failed to fetch
exchange.js:292 [ftx] received API products response => format products
exchange.js:210 [ftx] unknown pair BTCUSD
socket.js:322 [socket.connect] 1 successfully matched with BTCUSD
socket.js:331 [socket.connect] batch connect to bybit
exchange.js:107 [bybit] connecting... (BTCUSD)
index.js:30 Object "save.."
chartCache.js:20 [cache/saveChunk] 26/1 14:58:10 26/1 14:58:10
chartCache.js:40 [saveChunk] new cache range 26/1 14:58:10 -> 26/1 14:58:10

@Tucsky
Copy link
Owner

Tucsky commented Jan 26, 2021

When the app starts it fetch the latest products from all exchanges, and need to access exchange REST api to do so.
And exchanges do not allow direct request to REST api from browser due to CORS.

Setting PROXY_URL env var with your proxy server will fix that
Exemple in the .env
PROXY_URL=https://cors.aggr.trade/
meaning all the api requests will go through https://cors.aggr.trade which will do the request for you

cors.aggr.trade should work, but please setup your own, especially for production... -> https://github.com/Freeboard/thingproxy

@Schneider3000
Copy link

That worked! Thank you Tucsky :) Going to set up my thingproxy!

@Schneider3000
Copy link

When the app starts it fetch the latest products from all exchanges, and need to access exchange REST api to do so.
And exchanges do not allow direct request to REST api from browser due to CORS.

Setting PROXY_URL env var with your proxy server will fix that
Exemple in the .env
PROXY_URL=https://cors.aggr.trade/
meaning all the api requests will go through https://cors.aggr.trade which will do the request for you

cors.aggr.trade should work, but please setup your own, especially for production... -> https://github.com/Freeboard/thingproxy

Cors.aggr.trade worked perfectly. I set up my own thingproxy, and tried the following formats in the .env file

PROXY_URL=http:https://localhost:3000/

and also

PROXY_URL=http:https://localhost:3000/fetch/

Neither of which seem to work (they work in browser, though, for example this worked in browser: http:https://myserverip:3000/fetch/https://google.com

But, being set up in the .env file it doesnt seem to work for me

If I may ask, are you using thingproxy as well, did you do some modifications to the configuration file? I wonder if its my configuration blocking something right now in thingproxy.

@Tucsky
Copy link
Owner

Tucsky commented Jan 26, 2021

Hmm I don't see why really, is the app using the proxy url at all or ? (maybe you have another .env that override it ?)
I did a test and it is working as expected

PROXY_URL=https://thingproxy.freeboard.io/fetch/
in the .env ^

image

@Schneider3000
Copy link

I figured it out! The issue was on my end: I was using cloudflare, and something got messed up in the process. Once I disabled cloudflare and the use of https, everything started working! :)

@blake41
Copy link

blake41 commented Mar 8, 2021

@Tucsky I was able to deploy my own version of this on vercel. When I run locally all exchanges worked, and appear to have ws connections. I'm using my own proxy setup at heroku. For some reason bitmex doesn't work but all the other exchanges work on my deployed version. Any thoughts why that might be?
Here's the request that fails with 403.
Screen Shot 2021-03-08 at 5 52 15 AM

Also just wanted to give you a heads up on this point, I tried deploying to heroku and for some reason their env variables didn't seem to be working. Was banging my head against the wall and just could not get it working. I ended up just hard coding the proxy url in that vue config file but in case anyone else uses heroku maybe they will see this.

@blake41
Copy link

blake41 commented Mar 8, 2021

Also this is soooo useful. Thanks for your work.

@Tucsky
Copy link
Owner

Tucsky commented Mar 8, 2021

@blake41 Hard to tell, try look into https://gist.github.com/Tucsky/91060583d326926bbbfef580bb1bdd9e and compare with your proxu, see if there is anything you forgot to pass / remove into the final request
image

@blake41
Copy link

blake41 commented Mar 8, 2021

Wow I’m an idiot, totally forgot to look at the proxy logs...will keep debugging there. This proxy server will be helpful to see if there’s something I’m missing. Thanks!

@blake41
Copy link

blake41 commented Mar 8, 2021

Yup removing those headers in my proxy did it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants