Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle no-websocket error gracefully #20

Merged
merged 1 commit into from
May 16, 2023

Conversation

jrfrantz
Copy link
Contributor

The light node says it supports polygon but crashes when you try to do it.
Cause is that there is no reservoir websocket URL for polygon (ie see src/types/index.ts:33 which only has goerli and mainnet).

This PR unbreaks polygon by not attempting to connect the websocket if an unsupported chain is used.

@r3lays
Copy link
Contributor

r3lays commented May 16, 2023

Hey @jrfrantz! So the SyncNode did originally support Polygon. However we disabled it due to the fact that the WebSocket support for Polygon isn't out yet. As "asks" uses the WebSocket to handle the upkeeping.

The issue with running the SyncNode and not using the WebSocket is that it takes longer to get live/present "asks" to go into your database. This is due to the delay we have set of 1 minute (which is adjustable) to avoid hammering the API. We rely on the WebSocket to feed us realtime data, and we use the requests as a backup.

Good news is that Polygon support should be coming sometime this week. In any case, we can merge this since the SyncNode "asks" functionality will still work fine even without the WebSocket support.

@r3lays r3lays merged commit 6db6437 into reservoirprotocol:main May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants