speedmann / prometheus-chia-exporter

Prometheus exporter for several chia node statistics
GNU General Public License v3.0
30 stars 6 forks source link

Allow overriding hostnames via ENV #1

Closed strayer closed 3 years ago

strayer commented 3 years ago

Hey, thanks for creating this! I'm running chia in a docker container and would like to run this in a separate container, so I modified the code a bit to allow overriding the default hostname to something set by the environment. A quick test showed that this would work by using something like this, for example:

docker run --rm \
  --network chia-node_chia-node \
  -e FULL_NODE_HOST=chia \
  -e WALLET_HOST=chia \
  -e HARVESTER_HOST=chia \
  -e FARMER_HOST=chia \
  -v <somewhere>/chia/home/:/root/.chia/:ro \
  -p 12345:8000 \
  strayer/chia-exporter-test

I didn't add any environment for the RPC ports, since the config will need to be included anyway for the certificates and whatever else the Python chia library needs.

speedmann commented 3 years ago

Thank you. On first sight it looks good. I will have a closer look later on and merge it