Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions controls/roles/manage-service/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,20 @@ scrape_configs:
{% endif %}
]

# ethrex
- job_name: ethrex
metrics_path: /metrics
static_configs:
- targets: [
{% set targets = [] %}
{%- for service_config in service_configs.results %}
{%- if (service_config.content | b64decode | from_yaml).service == "EthrexService" %}
{%- set _ = targets.append("stereum-" ~ (service_config.content | b64decode | from_yaml).id ~ ":9090") %}
{%- endif %}
{% endfor %}
{% if targets %}
"{{ targets | join('",\n "') }}"
{% endif %}
]

# EOF
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions launcher/src/backend/Monitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ export class Monitoring {
BesuService: 8545,
NethermindService: 8545,
ErigonService: 8545,
EthrexService: 8545,
};

// Extract additional params
Expand Down Expand Up @@ -1109,6 +1110,7 @@ export class Monitoring {
NethermindService: ["nethermind_blocks", "nethermind_blocks"], // OK [there is only one label] - query for job="nethermind"
// Note: Erigon labels are taken from their official Grafana Dashboard, however those are not available thru Prometheus!
ErigonService: ["chain_head_header", "chain_head_block"], // TODO - query for job="erigon"
EthrexService: ["block_number", "head_height"], // NOT OK - query for job="ethrex"
},
};

Expand All @@ -1125,6 +1127,7 @@ export class Monitoring {
BesuService: "besu",
NethermindService: "nethermind",
ErigonService: "erigon",
EthrexService: "ethrex",
};

// Execution clients that should be queried by RPC for chain head block
Expand All @@ -1134,6 +1137,7 @@ export class Monitoring {
// 'BesuService',
"NethermindService",
"ErigonService",
"EthrexService",
];

// Merge all labels for Prometheus query
Expand Down Expand Up @@ -1317,6 +1321,7 @@ export class Monitoring {
BesuService: ["ethereum_peer_count"],
NethermindService: ["nethermind_sync_peers"],
ErigonService: ["p2p_peers"],
EthrexService: ["ethrex_p2p_peer_count"],
},
};

Expand All @@ -1333,6 +1338,7 @@ export class Monitoring {
BesuService: "besu",
NethermindService: "nethermind",
ErigonService: "erigon",
EthrexService: "ethrex",
};

// Merge all labels for Prometheus query
Expand Down Expand Up @@ -1478,6 +1484,11 @@ export class Monitoring {
// https://github.com/ledgerwatch/erigon/issues/2853
optnam = "--maxpeers";
defval = 100;
} else if (clt.service == "EthrexService") {
// --p2p.target-peers (Default: 100)
// https://docs.ethrex.xyz/CLI.html
optnam = "--p2p.target-peers";
defval = 100;
} else {
return;
}
Expand Down
8 changes: 8 additions & 0 deletions launcher/src/backend/OneClickInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ export class OneClickInstall {
this.executionClient.push(this.serviceManager.getService("ErigonService", args));
}

if (constellation.includes("EthrexService")) {
//EthrexService
this.executionClient.push(this.serviceManager.getService("EthrexService", args));
}

if (constellation.includes("FlashbotsMevBoostService")) {
//FlashbotsMevBoostService
this.mevboost = this.serviceManager.getService("FlashbotsMevBoostService", args);
Expand Down Expand Up @@ -517,6 +522,9 @@ export class OneClickInstall {
client.command[client.command.findIndex((c) => c.includes("--Pruning.Mode="))] = "--Pruning.Mode=None";
client.command = client.command.filter((c) => !c.includes("--Pruning.FullPruningTrigger"));
break;
case "EthrexService":
// TODO: add archive flags for ethrex (when they are available)
break;
}
});
this.beaconService
Expand Down
13 changes: 13 additions & 0 deletions launcher/src/backend/ServiceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { OpRethService } from "./ethereum-services/OpRethService";
import { OpNodeBeaconService } from "./ethereum-services/OpNodeBeaconService";
import { L2GethService } from "./ethereum-services/L2GethService";
import { SSVNOMService } from "./ethereum-services/SSVNOMService";
import { EthrexService } from "./ethereum-services/EthrexService";

import YAML from "yaml";
// import { file } from "jszip";
Expand Down Expand Up @@ -197,6 +198,8 @@ export class ServiceManager {
services.push(GrandineBeaconService.buildByConfiguration(config));
} else if (config.service == "SSVNOMService") {
services.push(SSVNOMService.buildByConfiguration(config));
} else if (config.service == "EthrexService") {
services.push(EthrexService.buildByConfiguration(config));
}
} else {
log.error("found configuration without service!");
Expand Down Expand Up @@ -1022,6 +1025,16 @@ export class ServiceManager {
service = ErigonService.buildByUserInput(args.network, ports, args.installDir + "/erigon");
return service;

case "EthrexService":
ports = [
new ServicePort(null, 30303, 30303, servicePortProtocol.tcp),
new ServicePort(null, 30303, 30303, servicePortProtocol.udp),
new ServicePort("127.0.0.1", args.port ? args.port : 8545, 8545, servicePortProtocol.tcp),
new ServicePort("127.0.0.1", 8546, 8546, servicePortProtocol.tcp),
];
service = EthrexService.buildByUserInput(args.network, ports, args.installDir + "/ethrex");
return service;

case "LighthouseBeaconService":
ports = [
new ServicePort(null, 9000, 9000, servicePortProtocol.tcp),
Expand Down
86 changes: 86 additions & 0 deletions launcher/src/backend/ethereum-services/EthrexService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { NodeService } from "./NodeService";
import { ServiceVolume } from "./ServiceVolume";

export class EthrexService extends NodeService {
static buildByUserInput(network, ports, dir) {
const service = new EthrexService();
service.setId();
const workingDir = service.buildWorkingDir(dir);
const dataDir = "/opt/app/data";
const JWTDir = "/engine.jwt";
const volumes = [new ServiceVolume(workingDir + "/data", "/opt/app/data"), new ServiceVolume(workingDir + "/engine.jwt", JWTDir)];
network = network === "op-mainnet" ? "mainnet" : network === "op-sepolia" ? "sepolia" : network;

service.init(
"EthrexService", // service
service.id, // id
1, // configVersion
"ghcr.io/lambdaclass/ethrex", // image
"9.0.0", // imageVersion
[
`--network=${network}`,
`--datadir=${dataDir}`,
"--syncmode=snap",
"--p2p.addr=0.0.0.0",
"--p2p.port=30303", //tcp
"--discovery.port=30303", //udp
"--http.addr=0.0.0.0",
"--http.port=8545",
"--ws.enabled",
"--ws.addr=0.0.0.0",
"--ws.port=8546",
"--authrpc.addr=0.0.0.0",
"--authrpc.port=8551",
`--authrpc.jwtsecret=${JWTDir}`,
"--log.level=info",
"--log.color=never",
"--metrics",
"--metrics.addr=0.0.0.0",
"--metrics.port=9090",
], // command
["ethrex"], // entrypoint
null, // env
ports, // ports
volumes, // volumes
null, // user
network // network
// executionClients
// consensusClients
);
return service;
}

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

service.initByConfig(config);

return service;
}

buildExecutionClientHttpEndpointUrl() {
return "http://stereum-" + this.id + ":8545";
}

buildExecutionClientWsEndpointUrl() {
return "ws://stereum-" + this.id + ":8546";
}

buildExecutionClientEngineRPCHttpEndpointUrl() {
return "http://stereum-" + this.id + ":8551";
}

buildExecutionClientEngineRPCWsEndpointUrl() {
return "ws://stereum-" + this.id + ":8551";
}

buildExecutionClientMetricsEndpoint() {
return "stereum-" + this.id + ":9090";
}

getDataDir() {
return this.volumes.find((volume) => volume.servicePath === "/opt/app/data")?.destinationPath;
}
}

// EOF
1 change: 1 addition & 0 deletions launcher/src/backend/ethereum-services/ServicePort.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const changeablePorts = {
GethService: 8545,
RethService: 8545,
NethermindService: 8545,
EthrexService: 8545,
LighthouseBeaconService: 5052,
LighthouseValidatorService: 5062,
LodestarBeaconService: 9596,
Expand Down
32 changes: 32 additions & 0 deletions launcher/src/store/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -2644,6 +2644,38 @@ export const useServices = defineStore("services", {
network: "",
},
},
{
id: 13,
name: "Ethrex",
service: "EthrexService",
category: "execution",
displayCategory: "exc",
displayTooltip: false,
displayPluginMenu: false,
serviceIsPending: false,
modifierPanel: false,
replacePanel: false,
addPanel: false,
path: "/ethrex",
linkUrl: "",
docsUrl: "https://docs.ethrex.xyz/",
icon: "/img/icon/service-icons/execution/Ethrex.png",
sIcon: "/img/icon/service-icons/execution/Ethrex-s.png",
headerOption: false,
expertOptionsModal: false,
expertOptions: [],
drag: true,
state: "exited",
config: {
serviceID: "",
configVersion: "",
image: "",
imageVersion: "",
ports: [],
volumes: [],
network: "",
},
},
],
versions: {},
stereumVersion: {},
Expand Down
Loading