Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Marketen committed Oct 10, 2024
1 parent 36b4283 commit bbc55a6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/brain/src/modules/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@ import { getTlsCert } from "./getTlsCert.js";
export const brainConfig = (): BrainConfig => {
const { network, executionClient, consensusClient, isMevBoostSet, shareDataWithDappnode } = loadEnvs();

// Determine the protocol based on the consensus client. Teku uses https (tls cert)
const validatorProtocol = consensusClient === "teku" ? "https" : "http";

// Determine the validator URL based on the consensus client and network.
// All this logic is needed because Teku has a TLS certificate that points to the old

Check failure on line 12 in packages/brain/src/modules/config/index.ts

View workflow job for this annotation

GitHub Actions / build

Delete `·`
// https://validator.teku-${network}.dappnode:3500 URL. TODO: update the Teku TLS certificate https://docs.teku.consensys.io/how-to/configure/tls
let validatorUrl;
if (consensusClient === "teku") {
if (network === "mainnet") {
validatorUrl = `https://validator.teku.dappnode:3500`;
} else {
validatorUrl = `https://validator.teku-${network}.dappnode:3500`;
}
validatorUrl = network === Network.Mainnet

Check failure on line 16 in packages/brain/src/modules/config/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `⏎·····`
? `https://validator.teku.dappnode:3500`

Check failure on line 17 in packages/brain/src/modules/config/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
: `https://validator.teku-${network}.dappnode:3500`;

Check failure on line 18 in packages/brain/src/modules/config/index.ts

View workflow job for this annotation

GitHub Actions / build

Insert `··`
} else {
validatorUrl = `${validatorProtocol}://validator.${network}.dncore.dappnode:3500`;
validatorUrl = `http://validator.${network}.dncore.dappnode:3500`;
}

return {
Expand Down

0 comments on commit bbc55a6

Please sign in to comment.