Open vnavascues opened 2 years ago
This is something we have been discussing internally. TL;DR: Right now you'll have to deploy a separate WS-enabled adapter in addition to your non-WS adapter.
In the future, we would like to make it possible to do something like specifying the protocol to use in the request to the EA, which would allow you to run a single EA.
If you're able to make code changes, adding shouldNotServeInputUsingWS()
should allow you to disable WS for that request. As long as this returns true
, it should just discard the attempt to use WS even if WS is enabled on the EA.
Interesting cause as I said above, triggering the shouldNotServeInputUsingWS()
did not work. This is the method that returns true
for non-ws coinmetrics endpoints and calls the expected execute():
shouldNotServeInputUsingWS: (input) => {
const noWsEndpoints = endpoints.totalBurned.supportedEndpoints.concat(
endpoints.burned.supportedEndpoints,
)
return noWsEndpoints.includes(input.data?.endpoint)
},
According the response message it defaults to price
endpoint (i.e. Required parameter base...
) instead of hitting total-burned
or burned
.
Thanks for the explanation
Hi, I'd like to know what's the best way to deal with an EA that has:
price
to be requested using websocketWS_ENABLED=true
For instance
total-burned
andprice
endpoints of thecoinmetrics-adapter
have to request /v4/timeseries/asset-metrics which does not support ws.This is the result of requesting any of these
coinmetrics-adapter
endpoints withWS_ENABLED=true
:Is it possible to achieve without running 2 instances of the same adapter (one with
WS_ENABLED=true
)? May be is just good practice having 2 instances?Triggering the shouldNotServeInputUsingWS via a function that returns a boolean per endpoint in makeWSHandler did not work. The only thing that worked was switching on/off the wsConfig.enabled but it felt hacky cause the code snippet was placed in the endpointSelector
Thanks!