From 4b9bcdb529df65bf679d4377e9d155fa33d348c7 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Tue, 10 Dec 2024 17:29:56 +0100 Subject: [PATCH] remove validator and beacon fullnode alises --- packages/stakers/src/consensus.ts | 2 +- packages/stakers/src/execution.ts | 2 +- packages/stakers/src/mevBoost.ts | 2 +- packages/stakers/src/signer.ts | 2 +- packages/stakers/src/stakerComponent.ts | 16 ++++++++-------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/stakers/src/consensus.ts b/packages/stakers/src/consensus.ts index c278ff0e8..4059bb79f 100644 --- a/packages/stakers/src/consensus.ts +++ b/packages/stakers/src/consensus.ts @@ -102,7 +102,7 @@ export class Consensus extends StakerComponent { await super.setNew({ newStakerDnpName: newConsensusDnpName, dockerNetworkName: params.DOCKER_STAKER_NETWORKS[network], - fullnodeAlias: `consensus.${network}.dncore.dappnode`, + fullnodeAliases: [`beacon-chain.${network}.dncore.dappnode`, `validator.${network}.dncore.dappnode`], compatibleClients: Consensus.CompatibleConsensus[network], userSettings, prevClient: prevConsClientDnpName diff --git a/packages/stakers/src/execution.ts b/packages/stakers/src/execution.ts index 112af4c7a..f1faffc8b 100644 --- a/packages/stakers/src/execution.ts +++ b/packages/stakers/src/execution.ts @@ -97,7 +97,7 @@ export class Execution extends StakerComponent { await super.setNew({ newStakerDnpName: newExecutionDnpName, dockerNetworkName: params.DOCKER_STAKER_NETWORKS[network], - fullnodeAlias: `execution.${network}.dncore.dappnode`, + fullnodeAliases: [`execution.${network}.dncore.dappnode`], compatibleClients: Execution.CompatibleExecutions[network], userSettings: await this.getUserSettings(network, newExecutionDnpName), prevClient: prevExecClientDnpName diff --git a/packages/stakers/src/mevBoost.ts b/packages/stakers/src/mevBoost.ts index 4ca675d1e..2ccf1fc9b 100644 --- a/packages/stakers/src/mevBoost.ts +++ b/packages/stakers/src/mevBoost.ts @@ -84,7 +84,7 @@ export class MevBoost extends StakerComponent { await super.setNew({ newStakerDnpName: newMevBoostDnpName, dockerNetworkName: params.DOCKER_STAKER_NETWORKS[network], - fullnodeAlias: `mev-boost.${network}.dncore.dappnode`, + fullnodeAliases: [`mev-boost.${network}.dncore.dappnode`], compatibleClients: compatibleMevBoost ? [compatibleMevBoost] : null, userSettings: newMevBoostDnpName ? this.getUserSettings(network, newRelays) : {}, prevClient: compatibleMevBoost ? compatibleMevBoost.dnpName : null diff --git a/packages/stakers/src/signer.ts b/packages/stakers/src/signer.ts index b0be7608f..bec0aa6f4 100644 --- a/packages/stakers/src/signer.ts +++ b/packages/stakers/src/signer.ts @@ -67,7 +67,7 @@ export class Signer extends StakerComponent { await super.setNew({ newStakerDnpName: newWeb3signerDnpName, dockerNetworkName: params.DOCKER_STAKER_NETWORKS[network], - fullnodeAlias: `signer.${network}.dncore.dappnode`, + fullnodeAliases: [`signer.${network}.dncore.dappnode`], compatibleClients: [Signer.CompatibleSigners[network]], userSettings: this.getUserSettings(network), prevClient: Signer.CompatibleSigners[network].dnpName diff --git a/packages/stakers/src/stakerComponent.ts b/packages/stakers/src/stakerComponent.ts index 24417647f..3595e027b 100644 --- a/packages/stakers/src/stakerComponent.ts +++ b/packages/stakers/src/stakerComponent.ts @@ -56,14 +56,14 @@ export class StakerComponent { protected async setNew({ newStakerDnpName, dockerNetworkName, - fullnodeAlias, + fullnodeAliases, compatibleClients, userSettings, prevClient }: { newStakerDnpName: string | null | undefined; dockerNetworkName: string; - fullnodeAlias: string; + fullnodeAliases: string[]; compatibleClients: | { dnpName: string; @@ -86,7 +86,7 @@ export class StakerComponent { if (prevClient && compatibleClients) this.ensureCompatibilityRequirements(prevClient, compatibleClients, currentPkg.version); if (prevClient !== newStakerDnpName) - await this.unsetStakerPkgConfig({ pkg: currentPkg, dockerNetworkName, fullnodeAlias }); + await this.unsetStakerPkgConfig({ pkg: currentPkg, dockerNetworkName, fullnodeAliases }); } if (!newStakerDnpName) return; @@ -184,14 +184,14 @@ export class StakerComponent { private async unsetStakerPkgConfig({ pkg, dockerNetworkName, - fullnodeAlias + fullnodeAliases }: { pkg: InstalledPackageData; dockerNetworkName: string; - fullnodeAlias: string; + fullnodeAliases: string[]; }): Promise { this.removeStakerNetworkFromCompose(pkg.dnpName, dockerNetworkName); - this.removeFullnodeAliasFromDncoreNetwork(pkg.dnpName, fullnodeAlias); + this.removeFullnodeAliasFromDncoreNetwork(pkg.dnpName, fullnodeAliases); // This recreates the package containers so that they include the recently added configuration // The flag --no-start is added so that the containers remain stopped after recreation @@ -202,7 +202,7 @@ export class StakerComponent { }); } - private removeFullnodeAliasFromDncoreNetwork(dnpName: string, fullnodeAlias: string): void { + private removeFullnodeAliasFromDncoreNetwork(dnpName: string, fullnodeAliases: string[]): void { const composeEditor = new ComposeFileEditor(dnpName, false); const services = composeEditor.compose.services; @@ -214,7 +214,7 @@ export class StakerComponent { for (const [networkName, networkSettings] of Object.entries(serviceNetworks)) { if (networkName === params.DOCKER_PRIVATE_NETWORK_NAME) { const aliases = networkSettings.aliases; - if (aliases) networkSettings.aliases = aliases.filter((alias) => alias !== fullnodeAlias); + if (aliases) networkSettings.aliases = aliases.filter((alias) => !fullnodeAliases.includes(alias)); } } }