Skip to content

Commit

Permalink
remove validator and beacon fullnode alises
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Dec 10, 2024
1 parent d2d44c7 commit 4b9bcdb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/stakers/src/consensus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/stakers/src/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/stakers/src/mevBoost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/stakers/src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions packages/stakers/src/stakerComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -184,14 +184,14 @@ export class StakerComponent {
private async unsetStakerPkgConfig({
pkg,
dockerNetworkName,
fullnodeAlias
fullnodeAliases
}: {
pkg: InstalledPackageData;
dockerNetworkName: string;
fullnodeAlias: string;
fullnodeAliases: string[];
}): Promise<void> {
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
Expand All @@ -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;

Expand All @@ -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));
}
}
}
Expand Down

0 comments on commit 4b9bcdb

Please sign in to comment.