Skip to content

Commit

Permalink
Merge pull request #1166 from dappnode/pablo/deprecate-geth-light
Browse files Browse the repository at this point in the history
Deprecate geth-light client
  • Loading branch information
pablomendezroyo authored Oct 26, 2022
2 parents 99109b2 + 7a8022c commit 01ddd3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/dappmanager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import initializeDb from "./initializeDb";
import { createGlobalEnvsEnvFile } from "./modules/globalEnvs";
import { generateKeyPair } from "./utils/publickeyEncryption";
import { copyHostScripts } from "./modules/hostScripts";
import { switchEthClientIfOpenethereum } from "./modules/ethClient";
import { switchEthClientIfOpenethereumOrGethLight } from "./modules/ethClient";
import { runLegacyActions } from "./modules/legacy";
import { migrateUserActionLogs } from "./logUserAction";
import { postRestartPatch } from "./modules/installer/restartPatch";
Expand Down Expand Up @@ -51,8 +51,8 @@ const server = startDappmanager({

// Deprecate openethereum. MUST be executed before EthClientInstaller daemon to avoid have the error:
// `Error on eth client installer daemon Error: No client data for target: openethereum`
switchEthClientIfOpenethereum().catch(e =>
logs.error("Error switch client openethereum", e)
switchEthClientIfOpenethereumOrGethLight().catch(e =>
logs.error("Error deprecating ethereum client: ", e)
);

// Initialize DB
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/modules/ethClient/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./changeEthMultiClient";
export * from "./ethersProvider";
export * from "./switchEthClientIfOpenethereum";
export * from "./switchEthClientIfOpenethereumOrGethLight";
export * from "./localFallbackVersions";
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { ethClientData } from "../../params";
/**
* Switches ethClientTarget in the following preference order: geth > nethermind > remote
*/
export async function switchEthClientIfOpenethereum(): Promise<void> {
export async function switchEthClientIfOpenethereumOrGethLight(): Promise<void> {
const ethClientTarget = db.ethClientTarget.get() as
| EthClientTarget
| null
| "openethereum"; // Add old deprecated type
| "openethereum" // Add old deprecated type
| "geth-light"; // Add old deprecated type

if (ethClientTarget === "openethereum") {
// Check for geth
Expand Down Expand Up @@ -45,5 +46,10 @@ export async function switchEthClientIfOpenethereum(): Promise<void> {

logs.info("Setting ethClientTarget to remote");
db.ethClientTarget.set("remote");
} else if (ethClientTarget === "geth-light") {
logs.info(
"Execution client geth-light deprecated in release v0.2.59. Using remote"
);
db.ethClientTarget.set("remote");
}
}

0 comments on commit 01ddd3a

Please sign in to comment.