Skip to content

Commit

Permalink
ADD: init L2geth
Browse files Browse the repository at this point in the history
  • Loading branch information
gbayasgalan committed Jan 24, 2025
1 parent 1eac4d9 commit afff44e
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
66 changes: 66 additions & 0 deletions launcher/src/backend/ethereum-services/L2GethService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { NodeService } from "./NodeService.js";
import { ServiceVolume } from "./ServiceVolume.js";

export class L2GethService extends NodeService {
// static buildByUserInput(network, dir, ports, executionClients) {
static buildByUserInput(network, ports, dir, executionClients) {
const service = new L2GethService();
service.setId();
const workingDir = service.buildWorkingDir(dir);

// const JWTDir = "/op-engine.jwt";
const dataDir = "/l2-geth";
const volumes = [new ServiceVolume(workingDir + "/data", dataDir)];
// const sequencer = network === "mainnet" ? "https://mainnet-sequencer.optimism.io" : "https://sepolia-sequencer.optimism.io";

// // L2 geth
// const l2Geth = executionClients
// .filter((client) => client.service.includes("L2GethService"))
// .map((client) => {
// return client.buildExecutionClientHttpEndpointUrl();
// })
// .join();

service.init(
"L2GethService", // service
service.id, // id
1, // configVersion
"ethereumoptimism/l2geth", // image
"0.5.31", // imageVersion
["--vmodule=eth/*=5,miner=4,rpc=5,rollup=4,consensus/clique=1", "--datadir=/l2geth", "--allow-insecure-unlock", "--gcmode=full"], // command
["geth"], // entrypoint
{
USING_OVM: "true",
ETH1_SYNC_SERVICE_ENABLE: "false",
RPC_API: "eth,rollup,net,web3,debug",
RPC_ADDR: "0.0.0.0",
RPC_CORS_DOMAIN: "*",
RPC_ENABLE: "true",
RPC_PORT: "8545",
RPC_VHOSTS: "*",
}, // env
ports, // ports
volumes, // volumes
"root", // user
network, // network
executionClients
// consensusClients
);

return service;
}

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

service.initByConfig(config);

return service;
}

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

// EOF
32 changes: 32 additions & 0 deletions launcher/src/store/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,38 @@ export const useServices = defineStore("services", {
network: "",
},
},
{
id: 36,
name: "L2Geth",
service: "L2GethService",
category: "execution",
displayCategory: "exc",
displayTooltip: false,
displayPluginMenu: false,
serviceIsPending: false,
modifierPanel: false,
replacePanel: false,
addPanel: false,
path: "/l2geth",
linkUrl: "",
docsUrl: "https://docs.optimism.io/",
icon: require("../..//public/img/icon/service-icons/execution/l2-geth.png"),
sIcon: require("../../public/img/icon/service-icons/execution/l2-geth.png"),
headerOption: false,
expertOptionsModal: false,
expertOptions: [],
drag: true,
state: "exited",
config: {
serviceID: "",
configVersion: "",
image: "",
imageVersion: "",
ports: [],
volumes: [],
network: "",
},
},
],
versions: {},
stereumVersion: {},
Expand Down

0 comments on commit afff44e

Please sign in to comment.