jl777 / SuperNET

57 stars 222 forks source link

Query multiple Electrum servers and use the fastest response #561

Open lukechilds opened 6 years ago

lukechilds commented 6 years ago

We’re having some pretty major user experience issues in our GUI implementation due to slow electrum servers. Sometimes the portfolio command takes a few mins to respond because one of the electrum servers is really slow.

It’s quite common in electrum clients to support connecting to multiple servers. You can query all connected servers and use the first response you get.

 Would you be open to implementing this in marketmaker? So GUI developers could register multiple electrum servers for the same coin. You just query all of them for balance updates and use the response from the fastest server. That way as long as at least one of the electrum servers is up and performing well the app will still function.

Currently if you use an electrum server that’s really slow, any marketmaker queries that rely on it take ages to resolve causing the UI to hang. Theres no information available to us as to what’s causing this so it just makes the UI seem really slow and buggy.

The only way to trouble shoot is to manually disable each coin one by one until the requests speed up again so can pin down the slow server and then switch over to a new server for that coin. But obviously the new server could also slow down in the future.

From Slack: https://komodo-platform.slack.com/archives/C0MN08277/p1517211235000359

lukechilds commented 6 years ago

For future reference:

The most likely solution to this will be for the client to implement it's own Electrum integration. Discussion here: https://github.com/jl777/SuperNET/issues/562#issuecomment-366151485