BuildOnViction / tomox-sdk

SDK to build a Decentralized Exchange on TomoX protocol
MIT License
36 stars 18 forks source link

paires and orderbook disappeared #138

Closed Luc-Michault closed 4 years ago

Luc-Michault commented 4 years ago

Hello, everything disappeared (paires and orderbook) from our DEX (https://trade.visiodex.com/) without any reason :

As you can see on https://trade.visiodex.com/api/market/stats/all API is returning an empty array.

Logs from mongodb container :

2020-06-07T11:16:24.129+0000 I  QUERY    [clientcursormon] Cursor id 4434506285680843465 timed out, idle since 2020-06-07T11:06:23.111+0000
2020-06-07T11:22:41.027+0000 I  NETWORK  [conn187] received client metadata from 172.17.0.1:51176 conn187: { driver: { version: "globalsign", name: "mgo" }, os: { type: "linux", architecture: "amd64" } }
2020-06-07T11:27:04.148+0000 I  QUERY    [clientcursormon] Cursor id 2779539488248960633 timed out, idle since 2020-06-07T11:17:01.153+0000
2020-06-07T11:50:28.182+0000 I  QUERY    [clientcursormon] Cursor id 457024679207454391 timed out, idle since 2020-06-07T11:40:26.087+0000
2020-06-07T11:58:46.645+0000 I  NETWORK  [conn186] received client metadata from 172.17.0.1:51172 conn186: { driver: { name: "mgo", version: "globalsign" }, os: { type: "linux", architecture: "amd64" } }
2020-06-07T12:08:44.210+0000 I  QUERY    [clientcursormon] Cursor id 8583887936985971674 timed out, idle since 2020-06-07T11:58:41.084+0000
2020-06-07T12:26:01.166+0000 I  NETWORK  [listener] connection accepted from 172.17.0.1:51228 #188 (178 connections now open)
2020-06-07T12:26:13.735+0000 I  NETWORK  [conn188] received client metadata from 172.17.0.1:51228 conn188: { driver: { name: "mgo", version: "globalsign" }, os: { architecture: "amd64", type: "linux" } }
2020-06-07T12:32:59.078+0000 I  NETWORK  [listener] connection accepted from 172.17.0.1:51276 #189 (179 connections now open)
2020-06-07T12:33:20.760+0000 I  NETWORK  [conn189] received client metadata from 172.17.0.1:51276 conn189: { driver: { name: "mgo", version: "globalsign" }, os: { type: "linux", architecture: "amd64" } }

Logs from rabbitmq :

2020-06-06 01:40:34.398 [error] <0.22634.0> closing AMQP connection <0.22634.0> (198.108.66.214:47010 -> 172.17.0.2:5672):
amqp1_0_plugin_not_enabled
2020-06-06 07:41:52.055 [info] <0.11829.1> accepting AMQP connection <0.11829.1> (172.17.0.1:58628 -> 172.17.0.2:5672)
2020-06-06 07:41:52.056 [info] <0.11829.1> connection <0.11829.1> (172.17.0.1:58628 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2020-06-06 11:18:44.123 [info] <0.25061.1> accepting AMQP connection <0.25061.1> (183.136.225.45:36103 -> 172.17.0.2:5672)
2020-06-06 11:18:44.123 [error] <0.25061.1> closing AMQP connection <0.25061.1> (183.136.225.45:36103 -> 172.17.0.2:5672):
{bad_header,<<"GET / HT">>}
2020-06-06 11:18:45.653 [info] <0.25065.1> accepting AMQP connection <0.25065.1> (183.136.225.45:15483 -> 172.17.0.2:5672)
2020-06-06 11:18:45.654 [error] <0.25065.1> closing AMQP connection <0.25065.1> (183.136.225.45:15483 -> 172.17.0.2:5672):
{bad_header,<<22,3,1,2,0,1,0,1>>}

I'm not seeing anything wrong there and i don't understand why this is not working. Help !

thanhson1085 commented 4 years ago

You can investigate the issue by checking infos:

Luc-Michault commented 4 years ago

Hello @thanhson1085 logs from tomox-sdk :

1|tomox-sd | INFO 09:59:00 at services/relayer.go:365 in updateCollateralTokenRelayer():Update collateral token: 0x0000000000000000000000000000000000000001
1|tomox-sd | INFO 09:59:00 at services/relayer.go:365 in updateCollateralTokenRelayer():Update collateral token: 0xAE44807D8A9CE4B30146437474Ed6fAAAFa1B809
1|tomox-sd | INFO 09:59:00 at services/relayer.go:365 in updateCollateralTokenRelayer():Update collateral token: 0x2EAA73Bd0db20c64f53fEbeA7b5F5E5Bccc7fb8b
1|tomox-sd | INFO 09:59:00 at services/relayer.go:416 in updateLendingTokenRelayer():Update lending token: 0x381B31409e4D220919B2cFF012ED94d70135A59e
1|tomox-sd | INFO 09:59:00 at services/relayer.go:130 in updateLendingPair():UpdateLendingPairRelayer starting... 0x08AabC34cfbb47575c80BA140dbBdFBCBd18D28f 0 0
1|tomox-sd | DEBU 09:59:06 at services/order.go:587 in watchChanges():Operation Type: insert
1|tomox-sd | WARN 09:59:06 at ws/orders.go:23 in GetOrderConnections():No connection found
1|tomox-sd | WARN 09:59:06 at ws/notification.go:23 in GetNotificationConnections():No connection found
1|tomox-sd | DEBU 09:59:08 at services/order.go:587 in watchChanges():Operation Type: insert
1|tomox-sd | DEBU 09:59:08 at services/order.go:587 in watchChanges():Operation Type: replace
1|tomox-sd | WARN 09:59:08 at ws/orders.go:23 in GetOrderConnections():No connection found
1|tomox-sd | WARN 09:59:08 at ws/notification.go:23 in GetNotificationConnections():No connection found
1|tomox-sd | WARN 09:59:08 at ws/orders.go:23 in GetOrderConnections():No connection found
1|tomox-sd | WARN 09:59:08 at ws/notification.go:23 in GetNotificationConnections():No connection found
1|tomox-sd | INFO 09:59:08 at services/order.go:441 in handleOrderCancelled():BroadcastOrderBookUpdate Cancelled

Fullnode is sync and running fine

Luc-Michault commented 4 years ago

What i tryed so far :

I just fully deleted and reinstalled rabbitmq and mongodb container, node lost more then 100k block sync. Waiting for it to be fully sync now.

Edit : Node is fully sync now and DEX is still not working.

thanhson1085 commented 4 years ago

Maybe you should try to reinstall the infa in a new server. I have no idea with your logs

Luc-Michault commented 4 years ago

So i reinstalled everything on a new server, node is sync and it's still not working!

thanhson1085 commented 4 years ago

Ok, we will investigate it.

Luc-Michault commented 4 years ago

@thanhnguyennguyen yes please check on your side, as i already said, we didn't do anything and it suddenly stopped working, so i'm pretty sure it's a problem from your side, like your firewall blocked our IP or something else as simple as that...

thanhson1085 commented 4 years ago

You DEX does not connect to your DEX, so firefall or network is not an issue. I will try to install a new DEX with your coinbase, if it works, there are somethings wrong in your side.

Luc-Michault commented 4 years ago

Ok but install it on another server then other relayers/dex, if they are all working, try it on a different environment please.

thanhson1085 commented 4 years ago

I tested the script on a new server with your coinbase (0x83c7399d01e3e1c20e5ffd7957c8666d73c1ad9b), it works properly Annotation 2020-06-09 164556

Luc-Michault commented 4 years ago

Is there any connection between dex and relayer to retrieve paires and fee options ? What https://trade.visiodex.com/api/tokens is calling to retrieve his informations ? It's doing the same thing with a wrong coinbase address

thanhson1085 commented 4 years ago

Everything run in your own server. Just fullnode connect to the other nodes

Luc-Michault commented 4 years ago

Trying to reinstall on a fresh new server from a different host, we'll see...

thanhson1085 commented 4 years ago

I have a suggestion for VisioDEX, that will have you to save the time. VisioDEX can use TomoChain's Support Program. You still run your own Frontend with our backend.

Just need to update .env file for your FE build: https://github.com/tomochain/tomox-sdk-ui/blob/master/.env.sample

REACT_APP_ENGINE_HTTP_URL=https://dex.tomochain.com/api
REACT_APP_ENGINE_WS_URL=wss://dex.tomochain.com/socket
Luc-Michault commented 4 years ago

Seems to be working on another host, but we won't ever know why it suddenly stopped working, even after a full reinstallation... i can provide root access to that server if you want to search.

thanhson1085 commented 4 years ago

Ok, we will check it later.