Skip to content

Commit

Permalink
REFACTOR: alpha DKG implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
daverolo committed May 8, 2024
1 parent 33a2cff commit e0ca94f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
22 changes: 10 additions & 12 deletions launcher/src/backend/OneClickInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,16 @@ export class OneClickInstall {
}

// add the dkgservice here
// if (constellation.includes("LidoObolExitService")) {
// //LidoObolExitService
// this.extraServices.push(
// this.serviceManager.getService("LidoObolExitService", {
// ...args,
// consensusClients: [this.beaconService].concat(
// this.extraServices.filter((s) => s.service === "CharonService")
// ),
// otherServices: this.extraServices.filter((s) => s.service === "ValidatorEjectorService"),
// })
// );
// }
if (constellation.includes("SSVDKGService")) {
//LidoObolExitService
this.extraServices.push(
this.serviceManager.getService("SSVDKGService", {
...args,
consensusClients: [this.beaconService],
otherServices: this.extraServices.filter((s) => s.service === "SSVNetworkService"),
})
);
}

this.handleArchiveTags(selectedPreset);

Expand Down
15 changes: 13 additions & 2 deletions launcher/src/backend/ServiceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,18 @@ export class ServiceManager {
args.consensusClients,
args.otherServices
);
case "SSVDKGService":
ports = [
new ServicePort(null, 3030, 3030, servicePortProtocol.udp),
new ServicePort(null, 3030, 3030, servicePortProtocol.tcp),
];
return SSVDKGService.buildByUserInput(
args.network,
ports,
args.installDir + "/ssvdkg",
args.consensusClients, // TOOD: remove later!
args.otherServices
);
}
}

Expand Down Expand Up @@ -1376,8 +1388,7 @@ export class ServiceManager {
s.service.includes("Teku") ||
s.service.includes("Nimbus") ||
s.service.includes("SSVNetwork") ||
s.service.includes("External") ||
s.service.includes("SSVDKGService") //just for testing
s.service.includes("External")
)
);
await this.initWeb3Signer(newServices.filter((s) => s.service === "Web3SignerService"));
Expand Down
29 changes: 13 additions & 16 deletions launcher/src/backend/ethereum-services/SSVDKGService.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeService } from "./NodeService.js";
// import { ServicePortDefinition } from "./SerivcePortDefinition.js";
import { ServicePortDefinition } from "./SerivcePortDefinition.js";
import { ServiceVolume } from "./ServiceVolume.js";

export class SSVDKGService extends NodeService {
Expand All @@ -8,14 +8,12 @@ export class SSVDKGService extends NodeService {
service.setId();
const workingDir = service.buildWorkingDir(dir);

const image = "sigp/lighthouse";

const dataDir = "/opt/app/validator";
const graffitiDir = "/opt/app/graffitis";
const image = "bloxstaking/ssv-dkg";

// TODO: use shared volume with SSVNetworkService!!!!
const volumes = [
new ServiceVolume(workingDir + "/validator", dataDir),
new ServiceVolume(workingDir + "/graffitis", graffitiDir),
new ServiceVolume(workingDir + "/data", "/data"),
new ServiceVolume(workingDir + "/secrets", "/secrets"),
];

// const eth2Nodes = consensusClients
Expand All @@ -30,8 +28,8 @@ export class SSVDKGService extends NodeService {
service.id, //id
1, //configVersion
image, //image
"v3.1.2", //imageVersion
["start-operator", "--configPath=/data/config.yaml"], //command
"v2.1.0", //imageVersion
["start-operator", "--configPath /data/config.yaml"], //command
null, // entrypoint
null, // env
ports, //ports
Expand All @@ -58,13 +56,12 @@ export class SSVDKGService extends NodeService {
return service;
}

// buildValidatorClientMetricsEndpoint() {
// return "stereum-" + this.id + ":5064";
// }

// getAvailablePorts() {
// return [new ServicePortDefinition(5062, "tcp", "Validator Client API")];
// }
getAvailablePorts() {
return [
new ServicePortDefinition(3030, "tcp", "TCP connections"),
new ServicePortDefinition(3030, "udp", "UDP connections"),
];
}
}

// EOF

0 comments on commit e0ca94f

Please sign in to comment.