0xProject / standard-relayer-api

Standard specifications for 0x relayer public APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

document websocket connection heartbeat interval

BlinkyStitt opened this issue · comments

I am using python's aiohttp library to handle websockets instead of your typescript library because I am just building a quick prototype and I know python better than javascript/typescript.

I have the subscribe command working and returning a bunch of orders, but 60 seconds after connecting, I get an error about an unclosed client session.

After some tinkering, I realized that I need to enable heartbeats to keep the connection alive. I changed my command to be async with http_session.ws_connect(relay_url, heartbeat=30) as ws:.

Heartbeats being necessary (and their recommended interval) should probably be added to the docs.

@wysenynja which API are you connected to?

RadarRelay.

Side note: is there a list of all the public open relays somewhere?