-
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add URLS for connected services
- Loading branch information
1 parent
bf5d92b
commit 4504a4a
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {LogLevel, Logger} from "@lodestar/utils"; | ||
import {GlobalArgs} from "../../options/index.js"; | ||
import {BeaconArgs} from "./options.js"; | ||
|
||
/** | ||
* Log urls from CLI arguments for execution.urls, eth1.providerUrls and builder.urls | ||
*/ | ||
export function logArguments(logger: Pick<Logger, LogLevel.info>, args: BeaconArgs & GlobalArgs): void { | ||
const executionUrls = args["execution.urls"]; | ||
|
||
if (executionUrls?.length > 0) { | ||
logger.info(`Total execution urls: ${executionUrls.length}`); | ||
executionUrls.forEach((url, index) => { | ||
logger.info(`Execution url (${index + 1}): ${url}`); | ||
}); | ||
} | ||
|
||
const eth1ProviderUrls = args["eth1.providerUrls"]; | ||
|
||
if (eth1ProviderUrls && eth1ProviderUrls?.length > 0) { | ||
logger.info(`Total eth1 provider urls: ${eth1ProviderUrls.length}`); | ||
eth1ProviderUrls.forEach((url, index) => { | ||
logger.info(`Eth1 provider url (${index + 1}): ${url}`); | ||
}); | ||
} | ||
|
||
const builderUrls = args["builder.urls"]; | ||
|
||
if (builderUrls && builderUrls?.length > 0) { | ||
logger.info(`Total builder url(s): ${builderUrls.length}`); | ||
builderUrls.forEach((url, index) => { | ||
logger.info(`Builder url (${index + 1}): ${url}`); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {LogLevel, Logger} from "@lodestar/utils"; | ||
import {GlobalArgs} from "../../options/index.js"; | ||
import {IValidatorCliArgs} from "./options.js"; | ||
|
||
/** | ||
* Log beacon node urls | ||
*/ | ||
export function logArguments(logger: Pick<Logger, LogLevel.info>, args: IValidatorCliArgs & GlobalArgs): void { | ||
const beaconNodes = args["beaconNodes"]; | ||
|
||
if (beaconNodes?.length > 0) { | ||
logger.info(`${beaconNodes.length} beacon nodes`); | ||
beaconNodes.forEach((url, index) => { | ||
logger.info(`Beacon node url ${index + 1}: ${url}`); | ||
}); | ||
} | ||
} |