Websocket Support
Hello team, I make fully onchain orderbook exchange with indexer on javascript, but I feel nervous that my indexer will not catch up to the speed when many users start to use it.
Then I see this rust indexer which is expected to integrate in rust. I am amazed to use this, but I want to see websocket support and guide on docs as I realized orderbook exchange only could work with subscription on trading event.
Could you please add websocket support in your project milestone?
so you want to supply a WS node instead of HTTP? would you expect it to listen to the WS for new data or would you be ok with it just doing the JSONRPC requests using the WS node?
Actually both WS node and HTTP node is needed. In Ponder, I use separate port for just listening to new events. Here is the issue I requested in ponder just to include socket.io’s io.
If this indexer follows design from Ponder, I hope it includes websocket object to emit events after spinning up transports and listening port in the config file. My fully decentralized onchain CLOB app gets current data with http GraphQL request, then updates the new data with websocket subscription to the indexer. This way, it is more efficient than sending http request periodically to the indexer for every 2~6 seconds. Periodically asking OHLCV information by 17k users in an event drastically increased server cost at the unsustainable level. To answer your question on usage of websocket, I would prefer listening to the WS for new data.
We'd need to migrate to alloy for this, as the Ws provider module for ethers is being deprecated , I believe #1 would be where to start with WS support
Yep need to take the hit and do it @nuts-rice