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

FR: Override expected daemon port #63

Open
jinnatar opened this issue Jan 15, 2023 · 3 comments
Open

FR: Override expected daemon port #63

jinnatar opened this issue Jan 15, 2023 · 3 comments
Assignees

Comments

@jinnatar
Copy link

Specifying: CHIA_EXPORTER_HOSTNAME=10.0.10.3:25166 results in the following error:
time="2023-01-15T15:06:24Z" level=error msg="dial tcp: address 10.0.10.3:25166:55400: too many colons in address"

Ergo, the accessible daemon port is always assumed to be the same as the one the target daemon is listening on, or hardcoded to 55400. In service mesh environments this is a false assumption and most of the time ports are dynamically configured and redirected to the default port, to avoid manual tweaking of configs since there's no flag or env parameter to override the listen port.

I'd recommend either having one option of:

  1. CHIA_EXPORTER_URL that defaults to localhost:55400 or infers the port from the config, which ever fits your design.
  2. CHIA_EXPORTER_HOSTNAME that defaults to localhost and CHIA_EXPORTER_PORT that defaults to 55400 or config inferring, again up to you.
@jinnatar
Copy link
Author

Digging deeper the problem is much more annoying, since many different ports are inferred from the config and used as-is, assuming the internal listen port values will be available.

As a practical pain, this all means I can't dynamically allocate the full-node on any node that's running a harvester, since the daemon port 55400 will conflict if I have to set them as static mappings instead of dynamic. Probably there need to be flags to allow overriding all URLs that will be dialed out which then stops the config inferring.

@cmmarslender
Copy link
Contributor

This is likely something we can support flags for. I believe we just added support for this to the underlying go library we use for this, so once thats working well, it can be brought over to the exporter as an enhancement.

@cmmarslender cmmarslender self-assigned this Jan 15, 2023
@cmmarslender
Copy link
Contributor

One possible way to override this right now is to set CHIA_ROOT for the exporter process, and put a config file that resembles the chia config into CHIA_ROOT/config/config.yaml - in there, you can set the ports to whatever values you want.

Its theoretically possible to add override support via flags to the underlying lib and chia-exporter, but in addition to the ports, we also need the certs that are defined in the config file, so it would end up being a ton of flags/env vars to set to achieve this (or else, you'd need both the config file and the overrides that dont match the config file)

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

No branches or pull requests

2 participants