Open errfrom opened 2 years ago
We'd need a helper though to construct the server configs given the current domain + security
What do you mean? Just helper functions to construct ServerConfig
s?
For ODC the path rewrite should be ws
:
mkOgmiosDatumCacheWsUrl :: ServerConfig -> Url
mkOgmiosDatumCacheWsUrl cfg = mkWsUrl cfg <> "/ws"
We'd need a helper though to construct the server configs given the current domain + security
What do you mean? Just helper functions to construct
ServerConfig
s?
Yeah, we can't define them statically as it depends on whether you're accessing the page locally or on some full domain or IP address, or if we're in https, so it'd have to be in Effect/Aff.
For ODC the path rewrite should be ws:
The dev server redirects all paths, so ws is handled automatically. Eg localhost:4008/odc/ws
-> localhost:9999/ws
I'm not sure if it is worth making these changes, however.
Yeah, we can't define them statically as it depends on whether you're accessing the page locally or on some full domain or IP address, or if we're in https, so it'd have to be in Effect/Aff.
This should not be a part of our API. I don't see why is it needed at all, we only care about the dev environment in examples, which is always the same.
This should not be a part of our API. I don't see why is it needed at all, we only care about the dev environment in examples, which is always the same.
As a developer you may want to run the demos on your phone/on another PC/in a mobile wallet browser (Lode being one). To do so you'll have to access it by at least your LAN IP address, which means changing the configuration. Not the end of the world, but we could just have it work anywhere by making this change.
The helper is pretty trivial to make, I might say, so we could just have it as an Example util which isn't part of the library API.
It's actually quite annoying when trying to run contracts in node rather than browser, because we don't use webpack for node and therefore can't use the default kupo serverconfig
Seems odd to do it just for Kupo, is there any reason for this? We could do it for all, I got it working as a quick test with the following:
The biggest benefit of doing this is we can have a single domain + port for all services, which makes it easy to do remote testing via things like ngrok. We'd need a helper though to construct the server configs given the current domain + security, rather than fixed. I'd prefer to make this a separate issue though to get peoples opinions
_Originally posted by @jy14898 in https://github.com/Plutonomicon/cardano-transaction-lib/pull/1185#discussion_r1020960578_