Skip to content

Commit

Permalink
ADD: staking csm preset
Browse files Browse the repository at this point in the history
  • Loading branch information
daverolo committed Jul 4, 2024
1 parent 4686920 commit bcbfa53
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 157 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions launcher/src/backend/OneClickInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,17 @@ export class OneClickInstall {
this.extraServices.push(this.serviceManager.getService("NotificationService", args));
}

if (constellation.includes("KeysAPIService")) {
//KeysAPIService
this.extraServices.push(
this.serviceManager.getService("KeysAPIService", {
...args,
consensusClients: [this.beaconService],
executionClients: [this.executionClient],
})
);
}

if (constellation.includes("ValidatorEjectorService")) {
//ValidatorEjectorService
this.extraServices.push(
Expand Down Expand Up @@ -410,6 +421,7 @@ export class OneClickInstall {
);
await this.serviceManager.createKeystores(this.needsKeystore);
await this.serviceManager.prepareSSVDKG(this.extraServices.find((s) => s.service === "SSVDKGService"));
await this.serviceManager.initKeysAPI(this.extraServices.filter((s) => s.service === "KeysAPIService"));
return configs;
}
}
Expand Down Expand Up @@ -503,6 +515,9 @@ export class OneClickInstall {
break;
case "lidossv":
services.push("SSVNetworkService", "SSVDKGService");
break;
case "lidocsm":
services.push("FlashbotsMevBoostService", "KeysAPIService", "ValidatorEjectorService");
}
return services;
}
Expand Down
2 changes: 1 addition & 1 deletion launcher/src/backend/ServiceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ export class ServiceManager {

case "KeysAPIService":
ports = [new ServicePort("127.0.0.1", 3600, 3600, servicePortProtocol.tcp)];
return KeysAPIService.buildByUserInput(args.network, ports);
return KeysAPIService.buildByUserInput(args.network, ports, args.executionClients, args.consensusClients);

case "SSVNetworkService":
ports = [
Expand Down
150 changes: 80 additions & 70 deletions launcher/src/backend/ethereum-services/KeysAPIService.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,84 @@
import { NodeService } from "./NodeService";

export class KeysAPIService extends NodeService {
static buildByUserInput(network, ports) {
const service = new KeysAPIService();
service.setId();

const image = "lidofinance/lido-keys-api";

service.init(
"KeysAPIService",
service.id, // id
1, // configVersion
image, // image
"dev", // imageVersion
[], // command
[], // entrypoint
{
// App
PORT: "3600",

// The number of seconds that each request will last in storage
GLOBAL_THROTTLE_TTL: "5",

// The maximum number of requests within the TTL limit
GLOBAL_THROTTLE_LIMIT: "100",

// Cache expiration time in seconds
GLOBAL_CACHE_TTL: "1",


// Log level: debug, info, notice, warning or error
LOG_LEVEL: "info",

// Log format: simple or json
LOG_FORMAT: "simple",
PROVIDERS_URLS: "http://your_el_node1,http://your_el_node2",
// chain id
// for mainnet 1
// for testnet 5
CHAIN_ID: network == "mainnet" ? "1" : "5",

DB_NAME: "node_operator_keys_service_db",
DB_PORT: "5432",
DB_HOST: "localhost",
DB_USER: "postgres",
DB_PASSWORD: "postgres",

// It is possible to enable/disable collecting of validators
// value below is default
VALIDATOR_REGISTRY_ENABLE: "true",

// CL api urls
// if VALIDATOR_REGISTRY_ENABLE=false , there are no need to provide CL_API_URLS
CL_API_URLS: "http://your_cl_node1,http://your_cl_node2"
}, // env
ports, // ports
[], // volumes
null, // user
network // network
// executionClients
// consensusClients
);
return service;
}

static buildByConfiguration(config) {
const service = new KeysAPIService();

service.initByConfig(config);

return service;
}
static buildByUserInput(network, ports, executionClients, consensusClients) {
const service = new KeysAPIService();
service.setId();

const image = "lidofinance/lido-keys-api";

service.init(
"KeysAPIService",
service.id, // id
1, // configVersion
image, // image
"dev", // imageVersion
[], // command
[], // entrypoint
{
// App
PORT: "3600",

// The number of seconds that each request will last in storage
GLOBAL_THROTTLE_TTL: "5",

// The maximum number of requests within the TTL limit
GLOBAL_THROTTLE_LIMIT: "100",

// Cache expiration time in seconds
GLOBAL_CACHE_TTL: "1",

// Log level: debug, info, notice, warning or error
LOG_LEVEL: "info",

// Log format: simple or json
LOG_FORMAT: "simple",

PROVIDERS_URLS: executionClients[0]
? executionClients[0].buildExecutionClientHttpEndpointUrl()
: "http://your_el_node1,http://your_el_node2",

// chain id
// for mainnet 1
// for testnet 17000
CHAIN_ID: network == "mainnet" ? "1" : "17000",

DB_NAME: "node_operator_keys_service_db",
DB_PORT: "5432",
DB_HOST: "localhost",
DB_USER: "postgres",
DB_PASSWORD: "postgres",

// It is possible to enable/disable collecting of validators
// value below is default
VALIDATOR_REGISTRY_ENABLE: "true",

// CL api urls
// if VALIDATOR_REGISTRY_ENABLE=false , there are no need to provide CL_API_URLS
CL_API_URLS: consensusClients[0]
? consensusClients[0].buildConsensusClientHttpEndpointUrl()
: "http://your_cl_node1,http://your_cl_node2",
}, // env
ports, // ports
[], // volumes
null, // user
// network // network
// // executionClients
// // consensusClients
network, // network
executionClients[0] ? [executionClients[0]] : [], // executionClients
consensusClients[0] ? [consensusClients[0]] : [], // consensusClients
[], // MevBoost
[] // otherServices
);
return service;
}

static buildByConfiguration(config) {
const service = new KeysAPIService();

service.initByConfig(config);

return service;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ export class ValidatorEjectorService extends NodeService {
let oracleAllowList = '["0x0000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000"]';
switch (network) {
case "mainnet":
locatorAddress = "0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb" //https://docs.lido.fi/deployed-contracts/#core-protocol
oracleAllowList = '["0x140Bd8FbDc884f48dA7cb1c09bE8A2fAdfea776E","0xA7410857ABbf75043d61ea54e07D57A6EB6EF186","0x404335BcE530400a5814375E7Ec1FB55fAff3eA2","0x946D3b081ed19173dC83Cd974fC69e1e760B7d78","0x007DE4a5F7bc37E2F26c0cb2E8A95006EE9B89b5","0xEC4BfbAF681eb505B94E4a7849877DC6c600Ca3A","0x61c91ECd902EB56e314bB2D5c5C07785444Ea1c8","0x1Ca0fEC59b86F549e1F1184d97cb47794C8Af58d","0xc79F702202E3A6B0B6310B537E786B9ACAA19BAf"]'
locatorAddress = "0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb"; //https://docs.lido.fi/deployed-contracts/#core-protocol
oracleAllowList =
'["0x140Bd8FbDc884f48dA7cb1c09bE8A2fAdfea776E","0xA7410857ABbf75043d61ea54e07D57A6EB6EF186","0x404335BcE530400a5814375E7Ec1FB55fAff3eA2","0x946D3b081ed19173dC83Cd974fC69e1e760B7d78","0x007DE4a5F7bc37E2F26c0cb2E8A95006EE9B89b5","0xEC4BfbAF681eb505B94E4a7849877DC6c600Ca3A","0x61c91ECd902EB56e314bB2D5c5C07785444Ea1c8","0x1Ca0fEC59b86F549e1F1184d97cb47794C8Af58d","0xc79F702202E3A6B0B6310B537E786B9ACAA19BAf"]';
break;
case "holesky":
locatorAddress = "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8" //https://docs.lido.fi/deployed-contracts/holesky#core-protocol
oracleAllowList = '["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399", "0xD892c09b556b547c80B7d8c8cB8d75bf541B2284", "0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5", "0x31fa51343297FFce0CC1E67a50B2D3428057D1b1", "0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4", "0x4c75FA734a39f3a21C57e583c1c29942F021C6B7", "0xD3b1e36A372Ca250eefF61f90E833Ca070559970", "0xF0F23944EfC5A63c53632C571E7377b85d5E6B6f", "0xb29dD2f6672C0DFF2d2f173087739A42877A5172", "0x3799bDA7B884D33F79CEC926af21160dc47fbe05"]'
locatorAddress = "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8"; //https://docs.lido.fi/deployed-contracts/holesky#core-protocol
oracleAllowList =
'["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399", "0xD892c09b556b547c80B7d8c8cB8d75bf541B2284", "0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5", "0x31fa51343297FFce0CC1E67a50B2D3428057D1b1", "0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4", "0x4c75FA734a39f3a21C57e583c1c29942F021C6B7", "0xD3b1e36A372Ca250eefF61f90E833Ca070559970", "0xF0F23944EfC5A63c53632C571E7377b85d5E6B6f", "0xb29dD2f6672C0DFF2d2f173087739A42877A5172", "0x3799bDA7B884D33F79CEC926af21160dc47fbe05"]';
break;
case "sepolia":
locatorAddress = "0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7" //https://docs.lido.fi/deployed-contracts/sepolia#core-protocol
locatorAddress = "0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7"; //https://docs.lido.fi/deployed-contracts/sepolia#core-protocol
break;
default:
break;
Expand All @@ -42,8 +44,8 @@ export class ValidatorEjectorService extends NodeService {
EXECUTION_NODE: executionClients[0] ? executionClients[0].buildExecutionClientHttpEndpointUrl() : "",
CONSENSUS_NODE: consensusClients[0] ? consensusClients[0].buildConsensusClientHttpEndpointUrl() : "",
LOCATOR_ADDRESS: locatorAddress,
STAKING_MODULE_ID: "123",
OPERATOR_ID: "123",
STAKING_MODULE_ID: "1",
OPERATOR_ID: "123456789",
MESSAGES_LOCATION: "/app/messages",
ORACLE_ADDRESSES_ALLOWLIST: oracleAllowList,
HTTP_PORT: "8989",
Expand Down
88 changes: 26 additions & 62 deletions launcher/src/components/UI/TheCarousel/components/TheCarousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,14 @@
>
<slide v-for="item in installStore.syncType" :key="item.name" aria-current="0">
<div class="w-full h-full flex justify-center items-center pl-2">
<div
v-if="item.name === 'genesis'"
class="w-full h-full flex flex-col justify-center items-start"
>
<span class="text-md text-gray-300 font-semibold text-left uppercase">{{
item.name
}}</span>
<span class="text-sm text-teal-600 font-semibold text-left">{{
item.type
}}</span>
<div v-if="item.name === 'genesis'" class="w-full h-full flex flex-col justify-center items-start">
<span class="text-md text-gray-300 font-semibold text-left uppercase">{{ item.name }}</span>
<span class="text-sm text-teal-600 font-semibold text-left">{{ item.type }}</span>
</div>
<div
v-else-if="item.type === 'custom source'"
class="w-full h-full flex justify-between items-center"
>
<div v-else-if="item.type === 'custom source'" class="w-full h-full flex justify-between items-center">
<div class="w-fit h-full flex flex-col justify-center items-start">
<span
class="w-fit h-5 text-sm text-gray-300 font-semibold text-left uppercase"
>{{ item.name }}</span
>
<span class="w-fit text-xs text-teal-600 font-semibold text-left">{{
item.type
}}</span>
<span class="w-fit h-5 text-sm text-gray-300 font-semibold text-left uppercase">{{ item.name }}</span>
<span class="w-fit text-xs text-teal-600 font-semibold text-left">{{ item.type }}</span>
</div>
<div class="w-[60%] h-full flex justify-center items-center">
<input
Expand All @@ -44,18 +29,10 @@
/>
</div>
</div>
<div
v-else-if="item.type === 'recommended'"
class="w-full h-full flex justify-between items-center"
>
<div v-else-if="item.type === 'recommended'" class="w-full h-full flex justify-between items-center">
<div class="w-fit h-full flex flex-col justify-center items-start">
<span
class="w-fit h-5 text-sm text-gray-300 font-semibold text-left uppercase"
>{{ item.name }}</span
>
<span class="w-fit text-xs text-teal-600 font-semibold text-left">{{
item.type
}}</span>
<span class="w-fit h-5 text-sm text-gray-300 font-semibold text-left uppercase">{{ item.name }}</span>
<span class="w-fit text-xs text-teal-600 font-semibold text-left">{{ item.type }}</span>
</div>

<div class="w-[60%] h-10 flex justify-center items-center">
Expand All @@ -72,38 +49,22 @@
@click="openDropdown"
>
<div class="col-start-1 col-span-1 self-center">
<img
v-if="selectedIcon"
class="w-6 ml-1"
:src="selectedIcon"
:alt="selectedItem"
/>
<img v-if="selectedIcon" class="w-6 ml-1" :src="selectedIcon" :alt="selectedItem" />
</div>
<div
v-if="selectedIcon"
class="extentions h-9 pt-5 col-start-2 col-end-6 text-md text-gray-300 flex justify-center items-center self-center"
>
<span class="text-sm text-gray-300 text-center">{{
selectedItem
}}</span>
<span class="text-sm text-gray-300 text-center">{{ selectedItem }}</span>
</div>
<div
v-else
class="extentions h-9 pt-5 col-start-2 col-end-6 text-md text-gray-300 flex justify-center items-center self-center"
>
<span class="text-sm text-gray-300 text-center">{{
selectedItem
}}</span>
<span class="text-sm text-gray-300 text-center">{{ selectedItem }}</span>
</div>
<div
class="col-start-6 col-span-1 self-center justify-self-end"
@click="openWindow"
>
<img
class="w-6"
src="/img/icon/service-modals-icons/internet.png"
alt="Internet"
/>
<div class="col-start-6 col-span-1 self-center justify-self-end" @click="openWindow">
<img class="w-6" src="/img/icon/service-modals-icons/internet.png" alt="Internet" />
</div>
</div>
</div>
Expand Down Expand Up @@ -149,12 +110,12 @@ import { computed, onMounted, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { Carousel, Navigation, Slide } from "vue3-carousel";
import "vue3-carousel/dist/carousel.css";
import { useSetups } from "../../../../store/setups";
// import { useSetups } from "../../../../store/setups";
// Store
const installStore = useClickInstall();
const manageStore = useNodeManage();
const setupStore = useSetups();
// const setupStore = useSetups();
const router = useRouter();
// Data
Expand All @@ -167,14 +128,17 @@ const selectedIcon = ref("");
// Computed properties
// const currentNetwork = computed(() => {
// let setupNetwork;
// let current;
// if (setupStore.selectedSetup) {
// setupNetwork = setupStore.selectedSetup.network;
// }
// current = manageStore.networkList.find((network) => network.name === setupNetwork);
// return current;
// });
const currentNetwork = computed(() => {
let setupNetwork;
let current;
if (setupStore.selectedSetup) {
setupNetwork = setupStore.selectedSetup.network;
}
current = manageStore.networkList.find((network) => network.name === setupNetwork);
return current;
return manageStore.currentNetwork;
});
const selectedLinks = computed(() => {
Expand Down
Loading

0 comments on commit bcbfa53

Please sign in to comment.