Skip to content

Commit

Permalink
Do not install exporter pkg if ethical metrics enabled
Browse files Browse the repository at this point in the history
Do not install exporter pkg if ethical metrics enabled
  • Loading branch information
pablomendezroyo committed Jul 22, 2024
1 parent 680afa4 commit ba5b19b
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/daemons/src/ethicalMetrics/checkEthicalMetricsStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import { InstalledPackageData } from "@dappnode/types";

/**
* Make sure that on Ethical metrics enabled and existing email,
* the packages exporter, DMS and Ethical metrics are installed and running
* the packages DMS and Ethical metrics are installed and running
*/
export async function checkEthicalMetricsStatus(
dappnodeInstaller: DappnodeInstaller
): Promise<void> {
const exporterDnpName = "dappnode-exporter.dnp.dappnode.eth";
const dmsDnpName = "dms.dnp.dappnode.eth";

try {
Expand All @@ -22,9 +21,8 @@ export async function checkEthicalMetricsStatus(
if (enabled) {
if (!mail && !tgChannelId) throw Error("mail or tgChannelId is required");

// First check for Ethical metrics, then for DMS and last for Exporter
// First check for Ethical metrics, then for DMS
// Ethical Metrics package has DMS as dependency, so it will be installed automatically
// DMS package has Exporter as dependency, so it will be installed automatically

// Check ethical metrics pkg
const ethicalMetricsPkg = await listPackageNoThrow({
Expand All @@ -42,14 +40,6 @@ export async function checkEthicalMetricsStatus(
await packageInstall(dappnodeInstaller, { name: dmsDnpName });
else ensureAllContainersRunning(dmsPkg);

// check exporter pkg
const exporterPkg = await listPackageNoThrow({
dnpName: exporterDnpName,
});
if (!exporterPkg)
await packageInstall(dappnodeInstaller, { name: exporterDnpName });
else ensureAllContainersRunning(exporterPkg);

// Register instance
await register({ mail, tgChannelId });
}
Expand Down

0 comments on commit ba5b19b

Please sign in to comment.