bra1n / cryptolights

Live visualisation of blockchain transactions for popular cryptocurrencies
https://bra1n.github.io/cryptolights/
BSD 3-Clause "New" or "Revised" License
61 stars 16 forks source link

Ethereum transaction WebSocket appears to be broken #7

Closed Pentagrade closed 4 years ago

Pentagrade commented 4 years ago

(Hi, really cool project btw)

I visited the site today noticing Ethereum transactions were absent. Digging in the console I can see the WebSocket it is trying to contact for ethereum tx info is returning a 503. I'm guessing the socket is broken or dead.

Just thought I'd bring this to attention as an issue for anyone wondering why it's not working.

WebSocket connection to 'wss://ethersocket.herokuapp.com/' failed: Error during WebSocket handshake: Unexpected response code: 503

bra1n commented 4 years ago

Hi, I'm aware of this issue but I wasn't able to find a solution for it yet. So far, the websocket that Cryptolights has been using was proxying the live transaction data from http://ethviewer.live/. Since that server went offline, I haven't found a new source that provides real-time unverified transactions that I could fetch through a socket. If you have any sources for this (and they have to be unverified transactions!) then please let me know and I'll update the page.

Pentagrade commented 4 years ago

Hi bra1n, I'm hoping pending transactions are the same as unverified, in which case I can see the difficulty clearly.

I went through a few pages here and there and found that Infura and Amberdata allow subscriptions to pending transactions. Here's a link to the docs for Amberdatas implementation: https://docs.amberdata.io/reference#ws-pending-transaction

Hope that helps, I believe they allow for a free API key, not sure if its rate limited however

bra1n commented 4 years ago

Ah yes, pending is what I meant. :-) Good find there, I'll look into the API and see if I can get the transactions through that. It seems that "raw blockchain events" should be included in the free tier, so I'll give it a try when I have a bit of time. Thanks!

Pentagrade commented 4 years ago

No problem, happy to help where I can :)

bra1n commented 4 years ago

Alright, looks like that API works and Ethereum is back up. Thanks again for researching this alternative! :-)

Pentagrade commented 4 years ago

I haven't noticed anything on the site yet, has it been released?

bra1n commented 4 years ago

It has... but it seems like the Amberdata websocket isn't sending data anymore. I'll have to investigate, maybe it got rate-limited super fast. :-/

bra1n commented 4 years ago

Alright, I added some code that cycles the socket every 5 minutes for my Heroku proxy server, let's see if that solves the issue. If it doesn't, then Amberdata might not be suitable after all...

bra1n commented 4 years ago

That seems to have done the trick.