@chainsafe/lodestar 1.35.0-dev.6dd6cec93a → 1.35.0-dev.792fcea33a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.git-data.json +1 -1
- package/bin/lodestar.js +3 -0
- package/bin/lodestar.ts +3 -0
- package/lib/applyPreset.d.ts.map +1 -0
- package/lib/applyPreset.js +1 -1
- package/lib/applyPreset.js.map +1 -1
- package/lib/cli.d.ts +3 -3
- package/lib/cli.d.ts.map +1 -0
- package/lib/cli.js +1 -1
- package/lib/cli.js.map +1 -1
- package/lib/cmds/beacon/handler.d.ts +1 -1
- package/lib/cmds/beacon/handler.d.ts.map +1 -0
- package/lib/cmds/beacon/handler.js +1 -1
- package/lib/cmds/beacon/handler.js.map +1 -1
- package/lib/cmds/beacon/index.d.ts.map +1 -0
- package/lib/cmds/beacon/initBeaconState.d.ts.map +1 -0
- package/lib/cmds/beacon/initBeaconState.js.map +1 -1
- package/lib/cmds/beacon/initPeerIdAndEnr.d.ts +2 -2
- package/lib/cmds/beacon/initPeerIdAndEnr.d.ts.map +1 -0
- package/lib/cmds/beacon/initPeerIdAndEnr.js +1 -1
- package/lib/cmds/beacon/initPeerIdAndEnr.js.map +1 -1
- package/lib/cmds/beacon/options.d.ts.map +1 -0
- package/lib/cmds/beacon/paths.d.ts.map +1 -0
- package/lib/cmds/bootnode/handler.d.ts +13 -8
- package/lib/cmds/bootnode/handler.d.ts.map +1 -0
- package/lib/cmds/bootnode/handler.js +2 -2
- package/lib/cmds/bootnode/handler.js.map +1 -1
- package/lib/cmds/bootnode/index.d.ts.map +1 -0
- package/lib/cmds/bootnode/options.d.ts.map +1 -0
- package/lib/cmds/bootnode/options.js +2 -1
- package/lib/cmds/bootnode/options.js.map +1 -1
- package/lib/cmds/dev/files.d.ts.map +1 -0
- package/lib/cmds/dev/handler.d.ts.map +1 -0
- package/lib/cmds/dev/handler.js +1 -1
- package/lib/cmds/dev/handler.js.map +1 -1
- package/lib/cmds/dev/index.d.ts.map +1 -0
- package/lib/cmds/dev/options.d.ts.map +1 -0
- package/lib/cmds/index.d.ts.map +1 -0
- package/lib/cmds/lightclient/handler.d.ts.map +1 -0
- package/lib/cmds/lightclient/index.d.ts.map +1 -0
- package/lib/cmds/lightclient/options.d.ts.map +1 -0
- package/lib/cmds/validator/blsToExecutionChange.d.ts.map +1 -0
- package/lib/cmds/validator/blsToExecutionChange.js.map +1 -1
- package/lib/cmds/validator/handler.d.ts.map +1 -0
- package/lib/cmds/validator/handler.js +3 -5
- package/lib/cmds/validator/handler.js.map +1 -1
- package/lib/cmds/validator/import.d.ts.map +1 -0
- package/lib/cmds/validator/index.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/decryptKeystoreDefinitions.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/decryptKeystores/index.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/decryptKeystores/poolSize.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.js +4 -1
- package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.js.map +1 -1
- package/lib/cmds/validator/keymanager/decryptKeystores/types.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/decryptKeystores/worker.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/impl.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/impl.js +4 -0
- package/lib/cmds/validator/keymanager/impl.js.map +1 -1
- package/lib/cmds/validator/keymanager/interface.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/keystoreCache.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/persistedKeys.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/persistedKeys.js +1 -0
- package/lib/cmds/validator/keymanager/persistedKeys.js.map +1 -1
- package/lib/cmds/validator/keymanager/server.d.ts.map +1 -0
- package/lib/cmds/validator/keymanager/server.js +2 -0
- package/lib/cmds/validator/keymanager/server.js.map +1 -1
- package/lib/cmds/validator/list.d.ts.map +1 -0
- package/lib/cmds/validator/options.d.ts.map +1 -0
- package/lib/cmds/validator/options.js +2 -2
- package/lib/cmds/validator/paths.d.ts.map +1 -0
- package/lib/cmds/validator/signers/importExternalKeystores.d.ts.map +1 -0
- package/lib/cmds/validator/signers/index.d.ts.map +1 -0
- package/lib/cmds/validator/signers/logSigners.d.ts.map +1 -0
- package/lib/cmds/validator/slashingProtection/export.d.ts.map +1 -0
- package/lib/cmds/validator/slashingProtection/import.d.ts.map +1 -0
- package/lib/cmds/validator/slashingProtection/index.d.ts.map +1 -0
- package/lib/cmds/validator/slashingProtection/options.d.ts.map +1 -0
- package/lib/cmds/validator/slashingProtection/utils.d.ts.map +1 -0
- package/lib/cmds/validator/slashingProtection/utils.js +1 -1
- package/lib/cmds/validator/slashingProtection/utils.js.map +1 -1
- package/lib/cmds/validator/voluntaryExit.d.ts.map +1 -0
- package/lib/cmds/validator/voluntaryExit.js +1 -1
- package/lib/cmds/validator/voluntaryExit.js.map +1 -1
- package/lib/config/beaconNodeOptions.d.ts.map +1 -0
- package/lib/config/beaconNodeOptions.js +2 -1
- package/lib/config/beaconNodeOptions.js.map +1 -1
- package/lib/config/beaconParams.d.ts.map +1 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/peerId.d.ts.map +1 -0
- package/lib/config/types.d.ts.map +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js.map +1 -1
- package/lib/migrations/index.d.ts +1 -0
- package/lib/migrations/index.d.ts.map +1 -0
- package/lib/migrations/index.js +1 -1
- package/lib/networks/chiado.d.ts.map +1 -0
- package/lib/networks/dev.d.ts.map +1 -0
- package/lib/networks/ephemery.d.ts.map +1 -0
- package/lib/networks/gnosis.d.ts.map +1 -0
- package/lib/networks/holesky.d.ts.map +1 -0
- package/lib/networks/hoodi.d.ts.map +1 -0
- package/lib/networks/index.d.ts.map +1 -0
- package/lib/networks/index.js +1 -2
- package/lib/networks/index.js.map +1 -1
- package/lib/networks/mainnet.d.ts.map +1 -0
- package/lib/networks/sepolia.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/api.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/builder.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/chain.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/eth1.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/execution.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/index.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/metrics.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/monitoring.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/network.d.ts +1 -0
- package/lib/options/beaconNodeOptions/network.d.ts.map +1 -0
- package/lib/options/beaconNodeOptions/network.js +6 -3
- package/lib/options/beaconNodeOptions/network.js.map +1 -1
- package/lib/options/beaconNodeOptions/sync.d.ts.map +1 -0
- package/lib/options/globalOptions.d.ts.map +1 -0
- package/lib/options/index.d.ts.map +1 -0
- package/lib/options/logOptions.d.ts.map +1 -0
- package/lib/options/paramsOptions.d.ts.map +1 -0
- package/lib/paths/global.d.ts.map +1 -0
- package/lib/paths/rootDir.d.ts.map +1 -0
- package/lib/util/errors.d.ts.map +1 -0
- package/lib/util/ethers.d.ts.map +1 -0
- package/lib/util/feeRecipient.d.ts.map +1 -0
- package/lib/util/file.d.ts.map +1 -0
- package/lib/util/file.js +1 -1
- package/lib/util/file.js.map +1 -1
- package/lib/util/format.d.ts.map +1 -0
- package/lib/util/fs.d.ts.map +1 -0
- package/lib/util/gitData/gitDataPath.d.ts.map +1 -0
- package/lib/util/gitData/index.d.ts.map +1 -0
- package/lib/util/gitData/index.js.map +1 -1
- package/lib/util/gitData/writeGitData.d.ts.map +1 -0
- package/lib/util/hasher_bun.d.ts +3 -0
- package/lib/util/hasher_bun.d.ts.map +1 -0
- package/lib/util/hasher_bun.js +118 -0
- package/lib/util/hasher_bun.js.map +1 -0
- package/lib/util/hasher_nodejs.d.ts +3 -0
- package/lib/util/hasher_nodejs.d.ts.map +1 -0
- package/lib/util/hasher_nodejs.js +3 -0
- package/lib/util/hasher_nodejs.js.map +1 -0
- package/lib/util/index.d.ts +3 -3
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +3 -3
- package/lib/util/index.js.map +1 -1
- package/lib/util/jwt.d.ts.map +1 -0
- package/lib/util/lockfile.d.ts.map +1 -0
- package/lib/util/logger.d.ts.map +1 -0
- package/lib/util/logger.js +1 -1
- package/lib/util/logger.js.map +1 -1
- package/lib/util/object.d.ts.map +1 -0
- package/lib/util/object.js.map +1 -1
- package/lib/util/passphrase.d.ts.map +1 -0
- package/lib/util/process.d.ts.map +1 -0
- package/lib/util/progress.d.ts.map +1 -0
- package/lib/util/proposerConfig.d.ts.map +1 -0
- package/lib/util/proposerConfig.js.map +1 -1
- package/lib/util/pruneOldFilesInDir.d.ts.map +1 -0
- package/lib/util/sleep.d.ts.map +1 -0
- package/lib/util/stripOffNewlines.d.ts.map +1 -0
- package/lib/util/types.d.ts.map +1 -0
- package/lib/util/version.d.ts.map +1 -0
- package/package.json +33 -20
- package/src/applyPreset.ts +92 -0
- package/src/cli.ts +56 -0
- package/src/cmds/beacon/handler.ts +267 -0
- package/src/cmds/beacon/index.ts +18 -0
- package/src/cmds/beacon/initBeaconState.ts +275 -0
- package/src/cmds/beacon/initPeerIdAndEnr.ts +199 -0
- package/src/cmds/beacon/options.ts +214 -0
- package/src/cmds/beacon/paths.ts +62 -0
- package/src/cmds/bootnode/handler.ts +203 -0
- package/src/cmds/bootnode/index.ts +13 -0
- package/src/cmds/bootnode/options.ts +109 -0
- package/src/cmds/dev/files.ts +52 -0
- package/src/cmds/dev/handler.ts +86 -0
- package/src/cmds/dev/index.ts +18 -0
- package/src/cmds/dev/options.ts +110 -0
- package/src/cmds/index.ts +15 -0
- package/src/cmds/lightclient/handler.ts +36 -0
- package/src/cmds/lightclient/index.ts +18 -0
- package/src/cmds/lightclient/options.ts +21 -0
- package/src/cmds/validator/blsToExecutionChange.ts +91 -0
- package/src/cmds/validator/handler.ts +300 -0
- package/src/cmds/validator/import.ts +111 -0
- package/src/cmds/validator/index.ts +28 -0
- package/src/cmds/validator/keymanager/decryptKeystoreDefinitions.ts +189 -0
- package/src/cmds/validator/keymanager/decryptKeystores/index.ts +1 -0
- package/src/cmds/validator/keymanager/decryptKeystores/poolSize.ts +16 -0
- package/src/cmds/validator/keymanager/decryptKeystores/threadPool.ts +75 -0
- package/src/cmds/validator/keymanager/decryptKeystores/types.ts +12 -0
- package/src/cmds/validator/keymanager/decryptKeystores/worker.ts +24 -0
- package/src/cmds/validator/keymanager/impl.ts +425 -0
- package/src/cmds/validator/keymanager/interface.ts +35 -0
- package/src/cmds/validator/keymanager/keystoreCache.ts +91 -0
- package/src/cmds/validator/keymanager/persistedKeys.ts +268 -0
- package/src/cmds/validator/keymanager/server.ts +86 -0
- package/src/cmds/validator/list.ts +35 -0
- package/src/cmds/validator/options.ts +461 -0
- package/src/cmds/validator/paths.ts +95 -0
- package/src/cmds/validator/signers/importExternalKeystores.ts +69 -0
- package/src/cmds/validator/signers/index.ts +176 -0
- package/src/cmds/validator/signers/logSigners.ts +81 -0
- package/src/cmds/validator/slashingProtection/export.ts +110 -0
- package/src/cmds/validator/slashingProtection/import.ts +70 -0
- package/src/cmds/validator/slashingProtection/index.ts +12 -0
- package/src/cmds/validator/slashingProtection/options.ts +15 -0
- package/src/cmds/validator/slashingProtection/utils.ts +56 -0
- package/src/cmds/validator/voluntaryExit.ts +232 -0
- package/src/config/beaconNodeOptions.ts +68 -0
- package/src/config/beaconParams.ts +87 -0
- package/src/config/index.ts +3 -0
- package/src/config/peerId.ts +50 -0
- package/src/config/types.ts +3 -0
- package/src/index.ts +28 -0
- package/src/migrations/index.ts +0 -0
- package/src/networks/chiado.ts +20 -0
- package/src/networks/dev.ts +27 -0
- package/src/networks/ephemery.ts +9 -0
- package/src/networks/gnosis.ts +18 -0
- package/src/networks/holesky.ts +17 -0
- package/src/networks/hoodi.ts +16 -0
- package/src/networks/index.ts +236 -0
- package/src/networks/mainnet.ts +34 -0
- package/src/networks/sepolia.ts +17 -0
- package/src/options/beaconNodeOptions/api.ts +110 -0
- package/src/options/beaconNodeOptions/builder.ts +63 -0
- package/src/options/beaconNodeOptions/chain.ts +326 -0
- package/src/options/beaconNodeOptions/eth1.ts +95 -0
- package/src/options/beaconNodeOptions/execution.ts +92 -0
- package/src/options/beaconNodeOptions/index.ts +50 -0
- package/src/options/beaconNodeOptions/metrics.ts +39 -0
- package/src/options/beaconNodeOptions/monitoring.ts +61 -0
- package/src/options/beaconNodeOptions/network.ts +401 -0
- package/src/options/beaconNodeOptions/sync.ts +65 -0
- package/src/options/globalOptions.ts +72 -0
- package/src/options/index.ts +3 -0
- package/src/options/logOptions.ts +70 -0
- package/src/options/paramsOptions.ts +72 -0
- package/src/paths/global.ts +24 -0
- package/src/paths/rootDir.ts +11 -0
- package/src/util/errors.ts +20 -0
- package/src/util/ethers.ts +44 -0
- package/src/util/feeRecipient.ts +6 -0
- package/src/util/file.ts +167 -0
- package/src/util/format.ts +76 -0
- package/src/util/fs.ts +59 -0
- package/src/util/gitData/gitDataPath.ts +48 -0
- package/src/util/gitData/index.ts +70 -0
- package/src/util/gitData/writeGitData.ts +10 -0
- package/src/util/hasher_bun.ts +133 -0
- package/src/util/hasher_nodejs.ts +3 -0
- package/src/util/index.ts +17 -0
- package/src/util/jwt.ts +10 -0
- package/src/util/lockfile.ts +45 -0
- package/src/util/logger.ts +105 -0
- package/src/util/object.ts +15 -0
- package/src/util/passphrase.ts +25 -0
- package/src/util/process.ts +25 -0
- package/src/util/progress.ts +58 -0
- package/src/util/proposerConfig.ts +136 -0
- package/src/util/pruneOldFilesInDir.ts +27 -0
- package/src/util/sleep.ts +3 -0
- package/src/util/stripOffNewlines.ts +6 -0
- package/src/util/types.ts +8 -0
- package/src/util/version.ts +74 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import {ArchiveMode, DEFAULT_ARCHIVE_MODE, IBeaconNodeOptions, defaultOptions} from "@lodestar/beacon-node";
|
|
2
|
+
import {CliCommandOptions} from "@lodestar/utils";
|
|
3
|
+
import {ensure0xPrefix} from "../../util/format.js";
|
|
4
|
+
|
|
5
|
+
export type ChainArgs = {
|
|
6
|
+
suggestedFeeRecipient: string;
|
|
7
|
+
serveHistoricalState?: boolean;
|
|
8
|
+
"chain.blacklistedBlocks"?: string[];
|
|
9
|
+
"chain.blsVerifyAllMultiThread"?: boolean;
|
|
10
|
+
"chain.blsVerifyAllMainThread"?: boolean;
|
|
11
|
+
"chain.disableBlsBatchVerify"?: boolean;
|
|
12
|
+
"chain.persistProducedBlocks"?: boolean;
|
|
13
|
+
"chain.persistInvalidSszObjects"?: boolean;
|
|
14
|
+
// No need to define chain.persistInvalidSszObjects as part of ChainArgs
|
|
15
|
+
// as this is defined as part of BeaconPaths
|
|
16
|
+
// "chain.persistInvalidSszObjectsDir": string;
|
|
17
|
+
"chain.persistOrphanedBlocks"?: boolean;
|
|
18
|
+
"chain.proposerBoost"?: boolean;
|
|
19
|
+
"chain.proposerBoostReorg"?: boolean;
|
|
20
|
+
"chain.disableImportExecutionFcU"?: boolean;
|
|
21
|
+
"chain.preaggregateSlotDistance"?: number;
|
|
22
|
+
"chain.attDataCacheSlotDistance"?: number;
|
|
23
|
+
"chain.computeUnrealized"?: boolean;
|
|
24
|
+
"chain.assertCorrectProgressiveBalances"?: boolean;
|
|
25
|
+
"chain.maxSkipSlots"?: number;
|
|
26
|
+
"safe-slots-to-import-optimistically": number;
|
|
27
|
+
emitPayloadAttributes?: boolean;
|
|
28
|
+
broadcastValidationStrictness?: string;
|
|
29
|
+
"chain.minSameMessageSignatureSetsToBatch"?: number;
|
|
30
|
+
"chain.maxShufflingCacheEpochs"?: number;
|
|
31
|
+
"chain.archiveStateEpochFrequency": number;
|
|
32
|
+
"chain.archiveDataEpochs"?: number;
|
|
33
|
+
"chain.archiveMode": ArchiveMode;
|
|
34
|
+
"chain.nHistoricalStates"?: boolean;
|
|
35
|
+
"chain.nHistoricalStatesFileDataStore"?: boolean;
|
|
36
|
+
"chain.maxBlockStates"?: number;
|
|
37
|
+
"chain.maxCPStateEpochsInMemory"?: number;
|
|
38
|
+
|
|
39
|
+
"chain.pruneHistory"?: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export function parseArgs(args: ChainArgs): IBeaconNodeOptions["chain"] {
|
|
43
|
+
return {
|
|
44
|
+
suggestedFeeRecipient: args.suggestedFeeRecipient,
|
|
45
|
+
serveHistoricalState: args.serveHistoricalState,
|
|
46
|
+
blacklistedBlocks: args["chain.blacklistedBlocks"],
|
|
47
|
+
blsVerifyAllMultiThread: args["chain.blsVerifyAllMultiThread"],
|
|
48
|
+
blsVerifyAllMainThread: args["chain.blsVerifyAllMainThread"],
|
|
49
|
+
disableBlsBatchVerify: args["chain.disableBlsBatchVerify"],
|
|
50
|
+
persistProducedBlocks: args["chain.persistProducedBlocks"],
|
|
51
|
+
persistInvalidSszObjects: args["chain.persistInvalidSszObjects"],
|
|
52
|
+
// biome-ignore lint/suspicious/noExplicitAny: We need to use `any` type here
|
|
53
|
+
persistInvalidSszObjectsDir: undefined as any,
|
|
54
|
+
persistOrphanedBlocks: args["chain.persistOrphanedBlocks"],
|
|
55
|
+
// biome-ignore lint/suspicious/noExplicitAny: We need to use `any` type here
|
|
56
|
+
persistOrphanedBlocksDir: undefined as any,
|
|
57
|
+
proposerBoost: args["chain.proposerBoost"],
|
|
58
|
+
proposerBoostReorg: args["chain.proposerBoostReorg"],
|
|
59
|
+
disableImportExecutionFcU: args["chain.disableImportExecutionFcU"],
|
|
60
|
+
preaggregateSlotDistance: args["chain.preaggregateSlotDistance"],
|
|
61
|
+
attDataCacheSlotDistance: args["chain.attDataCacheSlotDistance"],
|
|
62
|
+
computeUnrealized: args["chain.computeUnrealized"],
|
|
63
|
+
assertCorrectProgressiveBalances: args["chain.assertCorrectProgressiveBalances"],
|
|
64
|
+
maxSkipSlots: args["chain.maxSkipSlots"],
|
|
65
|
+
safeSlotsToImportOptimistically: args["safe-slots-to-import-optimistically"],
|
|
66
|
+
emitPayloadAttributes: args.emitPayloadAttributes,
|
|
67
|
+
broadcastValidationStrictness: args.broadcastValidationStrictness,
|
|
68
|
+
minSameMessageSignatureSetsToBatch:
|
|
69
|
+
args["chain.minSameMessageSignatureSetsToBatch"] ?? defaultOptions.chain.minSameMessageSignatureSetsToBatch,
|
|
70
|
+
maxShufflingCacheEpochs: args["chain.maxShufflingCacheEpochs"] ?? defaultOptions.chain.maxShufflingCacheEpochs,
|
|
71
|
+
archiveStateEpochFrequency: args["chain.archiveStateEpochFrequency"],
|
|
72
|
+
archiveDataEpochs: args["chain.archiveDataEpochs"],
|
|
73
|
+
archiveMode: args["chain.archiveMode"] ?? defaultOptions.chain.archiveMode,
|
|
74
|
+
nHistoricalStates: args["chain.nHistoricalStates"] ?? defaultOptions.chain.nHistoricalStates,
|
|
75
|
+
nHistoricalStatesFileDataStore:
|
|
76
|
+
args["chain.nHistoricalStatesFileDataStore"] ?? defaultOptions.chain.nHistoricalStatesFileDataStore,
|
|
77
|
+
maxBlockStates: args["chain.maxBlockStates"] ?? defaultOptions.chain.maxBlockStates,
|
|
78
|
+
maxCPStateEpochsInMemory: args["chain.maxCPStateEpochsInMemory"] ?? defaultOptions.chain.maxCPStateEpochsInMemory,
|
|
79
|
+
pruneHistory: args["chain.pruneHistory"],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const options: CliCommandOptions<ChainArgs> = {
|
|
84
|
+
suggestedFeeRecipient: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description:
|
|
87
|
+
"Specify fee recipient default for collecting the EL block fees and rewards (a hex string representing 20 bytes address: ^0x[a-fA-F0-9]{40}$) in case validator fails to update for a validator index before calling `produceBlock`.",
|
|
88
|
+
default: defaultOptions.chain.suggestedFeeRecipient,
|
|
89
|
+
group: "chain",
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
emitPayloadAttributes: {
|
|
93
|
+
type: "boolean",
|
|
94
|
+
defaultDescription: String(defaultOptions.chain.emitPayloadAttributes),
|
|
95
|
+
description: "Flag to SSE emit execution `payloadAttributes` before every slot",
|
|
96
|
+
group: "chain",
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
serveHistoricalState: {
|
|
100
|
+
description:
|
|
101
|
+
"Enable regenerating finalized state to serve historical data. Fetching this data is expensive and may affect validator performance.",
|
|
102
|
+
type: "boolean",
|
|
103
|
+
default: defaultOptions.chain.serveHistoricalState,
|
|
104
|
+
group: "chain",
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
"chain.blsVerifyAllMultiThread": {
|
|
108
|
+
hidden: true,
|
|
109
|
+
type: "boolean",
|
|
110
|
+
description: "Always use worker threads for BLS verification",
|
|
111
|
+
defaultDescription: String(defaultOptions.chain.blsVerifyAllMultiThread),
|
|
112
|
+
group: "chain",
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
"chain.blsVerifyAllMainThread": {
|
|
116
|
+
hidden: true,
|
|
117
|
+
type: "boolean",
|
|
118
|
+
description: "Always use main threads for BLS verification",
|
|
119
|
+
defaultDescription: String(defaultOptions.chain.blsVerifyAllMainThread),
|
|
120
|
+
group: "chain",
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
"chain.blacklistedBlocks": {
|
|
124
|
+
hidden: true,
|
|
125
|
+
type: "array",
|
|
126
|
+
string: true,
|
|
127
|
+
description:
|
|
128
|
+
"Comma-separated list of 0x-prefixed root hex's for blocks that should not be allowed through processing",
|
|
129
|
+
group: "chain",
|
|
130
|
+
coerce: (blocks: string[]): string[] =>
|
|
131
|
+
blocks
|
|
132
|
+
.flatMap((hex) => hex.split(","))
|
|
133
|
+
.map((hex) => hex.trim())
|
|
134
|
+
.map(ensure0xPrefix),
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
"chain.disableBlsBatchVerify": {
|
|
138
|
+
hidden: true,
|
|
139
|
+
type: "boolean",
|
|
140
|
+
description:
|
|
141
|
+
"Do not use BLS batch verify to validate all block signatures at once. \
|
|
142
|
+
Will double processing times. Use only for debugging purposes.",
|
|
143
|
+
defaultDescription: String(defaultOptions.chain.blsVerifyAllMultiThread),
|
|
144
|
+
group: "chain",
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
"chain.persistProducedBlocks": {
|
|
148
|
+
hidden: true,
|
|
149
|
+
type: "boolean",
|
|
150
|
+
description: "Persist produced blocks or not for debugging purpose",
|
|
151
|
+
group: "chain",
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
"chain.persistInvalidSszObjects": {
|
|
155
|
+
hidden: true,
|
|
156
|
+
type: "boolean",
|
|
157
|
+
description: "Persist invalid ssz objects or not for debugging purpose",
|
|
158
|
+
group: "chain",
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
"chain.persistOrphanedBlocks": {
|
|
162
|
+
hidden: true,
|
|
163
|
+
type: "boolean",
|
|
164
|
+
description: "Whether to persist orphaned blocks",
|
|
165
|
+
group: "chain",
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
"chain.proposerBoost": {
|
|
169
|
+
alias: ["chain.proposerBoostEnabled"],
|
|
170
|
+
hidden: true,
|
|
171
|
+
type: "boolean",
|
|
172
|
+
description: "Enable proposer boost to reward a timely block",
|
|
173
|
+
defaultDescription: String(defaultOptions.chain.proposerBoost),
|
|
174
|
+
group: "chain",
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
"chain.proposerBoostReorg": {
|
|
178
|
+
hidden: true,
|
|
179
|
+
type: "boolean",
|
|
180
|
+
description: "Enable proposer boost reorg to reorg out a late block",
|
|
181
|
+
defaultDescription: String(defaultOptions.chain.proposerBoostReorg),
|
|
182
|
+
group: "chain",
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
"chain.disableImportExecutionFcU": {
|
|
186
|
+
hidden: true,
|
|
187
|
+
type: "boolean",
|
|
188
|
+
description: "Disable issuing FcUs to the execution engine on block import",
|
|
189
|
+
group: "chain",
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
"chain.preaggregateSlotDistance": {
|
|
193
|
+
hidden: true,
|
|
194
|
+
type: "number",
|
|
195
|
+
description: "Only preaggregate attestations or sync committee message since clockSlot - preaggregateSlotDistance",
|
|
196
|
+
group: "chain",
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
"chain.attDataCacheSlotDistance": {
|
|
200
|
+
hidden: true,
|
|
201
|
+
type: "number",
|
|
202
|
+
description: "Only cache AttestationData since clockSlot - attDataCacheSlotDistance",
|
|
203
|
+
group: "chain",
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
"chain.computeUnrealized": {
|
|
207
|
+
hidden: true,
|
|
208
|
+
type: "boolean",
|
|
209
|
+
description: "Compute unrealized checkpoints and use it in fork choice or not",
|
|
210
|
+
defaultDescription: String(defaultOptions.chain.computeUnrealized),
|
|
211
|
+
group: "chain",
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
"chain.maxSkipSlots": {
|
|
215
|
+
hidden: true,
|
|
216
|
+
type: "number",
|
|
217
|
+
description: "Refuse to skip more than this many slots when processing a block or attestation",
|
|
218
|
+
group: "chain",
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
"chain.assertCorrectProgressiveBalances": {
|
|
222
|
+
hidden: true,
|
|
223
|
+
description: "Enable asserting the progressive balances",
|
|
224
|
+
type: "boolean",
|
|
225
|
+
group: "chain",
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
"safe-slots-to-import-optimistically": {
|
|
229
|
+
hidden: true,
|
|
230
|
+
type: "number",
|
|
231
|
+
description:
|
|
232
|
+
"Slots from current (clock) slot till which its safe to import a block optimistically if the merge is not justified yet.",
|
|
233
|
+
default: defaultOptions.chain.safeSlotsToImportOptimistically,
|
|
234
|
+
group: "chain",
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
"chain.archiveStateEpochFrequency": {
|
|
238
|
+
description: "Minimum number of epochs between archived states",
|
|
239
|
+
default: defaultOptions.chain.archiveStateEpochFrequency,
|
|
240
|
+
type: "number",
|
|
241
|
+
group: "chain",
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
"chain.archiveMode": {
|
|
245
|
+
hidden: true,
|
|
246
|
+
choices: Object.values(ArchiveMode),
|
|
247
|
+
description: `Strategy to manage archive states, only support ${DEFAULT_ARCHIVE_MODE} at this time`,
|
|
248
|
+
default: defaultOptions.chain.archiveMode,
|
|
249
|
+
type: "string",
|
|
250
|
+
group: "chain",
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
broadcastValidationStrictness: {
|
|
254
|
+
// TODO: hide the option till validations fully implemented
|
|
255
|
+
hidden: true,
|
|
256
|
+
description:
|
|
257
|
+
"'warn' or 'error' - options to either throw error or to log warning when broadcast validation can't be performed",
|
|
258
|
+
type: "string",
|
|
259
|
+
default: "warn",
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
"chain.minSameMessageSignatureSetsToBatch": {
|
|
263
|
+
hidden: true,
|
|
264
|
+
description: "Minimum number of same message signature sets to batch",
|
|
265
|
+
type: "number",
|
|
266
|
+
default: defaultOptions.chain.minSameMessageSignatureSetsToBatch,
|
|
267
|
+
group: "chain",
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
"chain.maxShufflingCacheEpochs": {
|
|
271
|
+
hidden: true,
|
|
272
|
+
description: "Maximum ShufflingCache epochs to keep in memory",
|
|
273
|
+
type: "number",
|
|
274
|
+
default: defaultOptions.chain.maxShufflingCacheEpochs,
|
|
275
|
+
group: "chain",
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
"chain.archiveDataEpochs": {
|
|
279
|
+
alias: "chain.archiveBlobEpochs",
|
|
280
|
+
description:
|
|
281
|
+
"Number of epochs to retain finalized blobs/columns (minimum of MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS/MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS)",
|
|
282
|
+
type: "number",
|
|
283
|
+
group: "chain",
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
"chain.nHistoricalStates": {
|
|
287
|
+
hidden: true,
|
|
288
|
+
description:
|
|
289
|
+
"Use the new FIFOBlockStateCache and PersistentCheckpointStateCache or not which make lodestar heap size bounded instead of unbounded as before",
|
|
290
|
+
type: "boolean",
|
|
291
|
+
default: defaultOptions.chain.nHistoricalStates,
|
|
292
|
+
group: "chain",
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
"chain.nHistoricalStatesFileDataStore": {
|
|
296
|
+
hidden: true,
|
|
297
|
+
description: "Use fs to store checkpoint state for PersistentCheckpointStateCache or not",
|
|
298
|
+
type: "boolean",
|
|
299
|
+
default: defaultOptions.chain.nHistoricalStatesFileDataStore,
|
|
300
|
+
group: "chain",
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
"chain.maxBlockStates": {
|
|
304
|
+
hidden: true,
|
|
305
|
+
description: "Max block states to cache in memory, used for FIFOBlockStateCache",
|
|
306
|
+
type: "number",
|
|
307
|
+
default: defaultOptions.chain.maxBlockStates,
|
|
308
|
+
group: "chain",
|
|
309
|
+
},
|
|
310
|
+
|
|
311
|
+
"chain.maxCPStateEpochsInMemory": {
|
|
312
|
+
hidden: true,
|
|
313
|
+
description: "Max epochs to cache checkpoint states in memory, used for PersistentCheckpointStateCache",
|
|
314
|
+
type: "number",
|
|
315
|
+
default: defaultOptions.chain.maxCPStateEpochsInMemory,
|
|
316
|
+
group: "chain",
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
"chain.pruneHistory": {
|
|
320
|
+
hidden: true,
|
|
321
|
+
description: "Prune historical blocks and state",
|
|
322
|
+
type: "boolean",
|
|
323
|
+
default: defaultOptions.chain.pruneHistory,
|
|
324
|
+
group: "chain",
|
|
325
|
+
},
|
|
326
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import {IBeaconNodeOptions, defaultOptions} from "@lodestar/beacon-node";
|
|
3
|
+
import {CliCommandOptions} from "@lodestar/utils";
|
|
4
|
+
import {extractJwtHexSecret} from "../../util/index.js";
|
|
5
|
+
import {ExecutionEngineArgs} from "./execution.js";
|
|
6
|
+
|
|
7
|
+
export type Eth1Args = {
|
|
8
|
+
eth1?: boolean;
|
|
9
|
+
"eth1.providerUrls"?: string[];
|
|
10
|
+
"eth1.depositContractDeployBlock"?: number;
|
|
11
|
+
"eth1.disableEth1DepositDataTracker"?: boolean;
|
|
12
|
+
"eth1.unsafeAllowDepositDataOverwrite"?: boolean;
|
|
13
|
+
"eth1.forcedEth1DataVote"?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function parseArgs(args: Eth1Args & Partial<ExecutionEngineArgs>): IBeaconNodeOptions["eth1"] {
|
|
17
|
+
let jwtSecretHex: string | undefined;
|
|
18
|
+
let jwtId: string | undefined;
|
|
19
|
+
|
|
20
|
+
let providerUrls = args["eth1.providerUrls"];
|
|
21
|
+
|
|
22
|
+
// If no providerUrls are explicitly provided, we should pick the execution endpoint
|
|
23
|
+
// because as per Kiln spec v2.1, execution *must* host the `eth_` methods necessary
|
|
24
|
+
// for deposit and merge trackers on engine endpoints as well protected by a
|
|
25
|
+
// jwt auth mechanism.
|
|
26
|
+
if (providerUrls === undefined && args["execution.urls"]) {
|
|
27
|
+
providerUrls = args["execution.urls"];
|
|
28
|
+
jwtSecretHex = args.jwtSecret ? extractJwtHexSecret(fs.readFileSync(args.jwtSecret, "utf-8").trim()) : undefined;
|
|
29
|
+
jwtId = args.jwtId;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
enabled: args.eth1,
|
|
34
|
+
providerUrls,
|
|
35
|
+
jwtSecretHex,
|
|
36
|
+
jwtId,
|
|
37
|
+
depositContractDeployBlock: args["eth1.depositContractDeployBlock"],
|
|
38
|
+
disableEth1DepositDataTracker: args["eth1.disableEth1DepositDataTracker"],
|
|
39
|
+
unsafeAllowDepositDataOverwrite: args["eth1.unsafeAllowDepositDataOverwrite"],
|
|
40
|
+
forcedEth1DataVote: args["eth1.forcedEth1DataVote"],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const options: CliCommandOptions<Eth1Args> = {
|
|
45
|
+
eth1: {
|
|
46
|
+
description: "Whether to follow the eth1 chain",
|
|
47
|
+
type: "boolean",
|
|
48
|
+
defaultDescription: String(defaultOptions.eth1.enabled),
|
|
49
|
+
group: "eth1",
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
"eth1.providerUrls": {
|
|
53
|
+
description:
|
|
54
|
+
"Urls to Eth1 node with enabled rpc. If not explicitly provided and execution endpoint provided via execution.urls, it will use execution.urls. Otherwise will try connecting on the specified default(s)",
|
|
55
|
+
defaultDescription: defaultOptions.eth1.providerUrls?.join(","),
|
|
56
|
+
type: "array",
|
|
57
|
+
string: true,
|
|
58
|
+
coerce: (urls: string[]): string[] =>
|
|
59
|
+
// Parse ["url1,url2"] to ["url1", "url2"]
|
|
60
|
+
urls.flatMap((item) => item.split(",")),
|
|
61
|
+
group: "eth1",
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
"eth1.depositContractDeployBlock": {
|
|
65
|
+
hidden: true,
|
|
66
|
+
description: "Block number at which the deposit contract contract was deployed",
|
|
67
|
+
type: "number",
|
|
68
|
+
defaultDescription: String(defaultOptions.eth1.depositContractDeployBlock),
|
|
69
|
+
group: "eth1",
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
"eth1.disableEth1DepositDataTracker": {
|
|
73
|
+
hidden: true,
|
|
74
|
+
description: "Disable Eth1DepositDataTracker modules",
|
|
75
|
+
type: "boolean",
|
|
76
|
+
defaultDescription: String(defaultOptions.eth1.disableEth1DepositDataTracker),
|
|
77
|
+
group: "eth1",
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
"eth1.unsafeAllowDepositDataOverwrite": {
|
|
81
|
+
hidden: true,
|
|
82
|
+
description:
|
|
83
|
+
"Allow the deposit tracker to overwrite previously fetched and saved deposit event data. Warning!!! This is an unsafe operation, so enable this flag only if you know what you are doing.",
|
|
84
|
+
type: "boolean",
|
|
85
|
+
defaultDescription: String(defaultOptions.eth1.unsafeAllowDepositDataOverwrite),
|
|
86
|
+
group: "eth1",
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
"eth1.forcedEth1DataVote": {
|
|
90
|
+
hidden: true,
|
|
91
|
+
description: "Vote for a specific eth1_data regardless of all conditions. Hex encoded ssz serialized Eth1Data type",
|
|
92
|
+
type: "string",
|
|
93
|
+
group: "eth1",
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import {IBeaconNodeOptions, defaultExecutionEngineHttpOpts} from "@lodestar/beacon-node";
|
|
3
|
+
import {CliCommandOptions} from "@lodestar/utils";
|
|
4
|
+
import {extractJwtHexSecret} from "../../util/index.js";
|
|
5
|
+
|
|
6
|
+
export type ExecutionEngineArgs = {
|
|
7
|
+
"execution.urls": string[];
|
|
8
|
+
"execution.timeout"?: number;
|
|
9
|
+
"execution.retries": number;
|
|
10
|
+
"execution.retryDelay": number;
|
|
11
|
+
"execution.engineMock"?: boolean;
|
|
12
|
+
jwtSecret?: string;
|
|
13
|
+
jwtId?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function parseArgs(args: ExecutionEngineArgs): IBeaconNodeOptions["executionEngine"] {
|
|
17
|
+
if (args["execution.engineMock"]) {
|
|
18
|
+
return {
|
|
19
|
+
mode: "mock",
|
|
20
|
+
genesisBlockHash: "",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
urls: args["execution.urls"],
|
|
26
|
+
timeout: args["execution.timeout"],
|
|
27
|
+
retries: args["execution.retries"],
|
|
28
|
+
retryDelay: args["execution.retryDelay"],
|
|
29
|
+
/**
|
|
30
|
+
* jwtSecret is parsed as hex instead of bytes because the merge with defaults
|
|
31
|
+
* in beaconOptions messes up the bytes array as as index => value object
|
|
32
|
+
*/
|
|
33
|
+
jwtSecretHex: args.jwtSecret ? extractJwtHexSecret(fs.readFileSync(args.jwtSecret, "utf-8").trim()) : undefined,
|
|
34
|
+
jwtId: args.jwtId,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const options: CliCommandOptions<ExecutionEngineArgs> = {
|
|
39
|
+
"execution.urls": {
|
|
40
|
+
description: "Urls to execution client engine API",
|
|
41
|
+
default: defaultExecutionEngineHttpOpts.urls.join(","),
|
|
42
|
+
type: "array",
|
|
43
|
+
string: true,
|
|
44
|
+
coerce: (urls: string[]): string[] =>
|
|
45
|
+
// Parse ["url1,url2"] to ["url1", "url2"]
|
|
46
|
+
urls.flatMap((item) => item.split(",")),
|
|
47
|
+
group: "execution",
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
"execution.timeout": {
|
|
51
|
+
description: "Timeout in milliseconds for execution engine API HTTP client",
|
|
52
|
+
type: "number",
|
|
53
|
+
defaultDescription: String(defaultExecutionEngineHttpOpts.timeout),
|
|
54
|
+
group: "execution",
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
"execution.retries": {
|
|
58
|
+
alias: ["execution.retryAttempts"],
|
|
59
|
+
description: "Number of retries when calling execution engine API",
|
|
60
|
+
type: "number",
|
|
61
|
+
default: defaultExecutionEngineHttpOpts.retries,
|
|
62
|
+
group: "execution",
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
"execution.retryDelay": {
|
|
66
|
+
description: "Delay time in milliseconds between retries when retrying calls to the execution engine API",
|
|
67
|
+
type: "number",
|
|
68
|
+
default: defaultExecutionEngineHttpOpts.retryDelay,
|
|
69
|
+
group: "execution",
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
"execution.engineMock": {
|
|
73
|
+
description: "Set the execution engine to mock mode (development only)",
|
|
74
|
+
type: "boolean",
|
|
75
|
+
hidden: false,
|
|
76
|
+
group: "execution",
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
jwtSecret: {
|
|
80
|
+
description:
|
|
81
|
+
"File path to a shared hex-encoded jwt secret which will be used to generate and bundle HS256 encoded jwt tokens for authentication with the EL client's rpc server hosting engine apis. Secret to be exactly same as the one used by the corresponding EL client.",
|
|
82
|
+
type: "string",
|
|
83
|
+
group: "execution",
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
jwtId: {
|
|
87
|
+
description:
|
|
88
|
+
"An optional identifier to be set in the id field of the claims included in jwt tokens used for authentication with EL client's rpc server hosting engine apis",
|
|
89
|
+
type: "string",
|
|
90
|
+
group: "execution",
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {IBeaconNodeOptions} from "@lodestar/beacon-node";
|
|
2
|
+
import {RecursivePartial} from "@lodestar/utils";
|
|
3
|
+
import {removeUndefinedRecursive} from "../../util/index.js";
|
|
4
|
+
import * as api from "./api.js";
|
|
5
|
+
import * as builder from "./builder.js";
|
|
6
|
+
import * as chain from "./chain.js";
|
|
7
|
+
import * as eth1 from "./eth1.js";
|
|
8
|
+
import * as execution from "./execution.js";
|
|
9
|
+
import * as metrics from "./metrics.js";
|
|
10
|
+
import * as monitoring from "./monitoring.js";
|
|
11
|
+
import * as network from "./network.js";
|
|
12
|
+
import * as sync from "./sync.js";
|
|
13
|
+
|
|
14
|
+
export type BeaconNodeArgs = api.ApiArgs &
|
|
15
|
+
chain.ChainArgs &
|
|
16
|
+
eth1.Eth1Args &
|
|
17
|
+
execution.ExecutionEngineArgs &
|
|
18
|
+
builder.ExecutionBuilderArgs &
|
|
19
|
+
metrics.MetricsArgs &
|
|
20
|
+
monitoring.MonitoringArgs &
|
|
21
|
+
network.NetworkArgs &
|
|
22
|
+
sync.SyncArgs;
|
|
23
|
+
|
|
24
|
+
export function parseBeaconNodeArgs(args: BeaconNodeArgs): RecursivePartial<IBeaconNodeOptions> {
|
|
25
|
+
// Remove undefined values to allow deepmerge to inject default values downstream
|
|
26
|
+
return removeUndefinedRecursive({
|
|
27
|
+
api: api.parseArgs(args),
|
|
28
|
+
chain: chain.parseArgs(args),
|
|
29
|
+
// db: {},
|
|
30
|
+
eth1: eth1.parseArgs(args),
|
|
31
|
+
executionEngine: execution.parseArgs(args),
|
|
32
|
+
executionBuilder: builder.parseArgs(args),
|
|
33
|
+
metrics: metrics.parseArgs(args),
|
|
34
|
+
monitoring: monitoring.parseArgs(args),
|
|
35
|
+
network: network.parseArgs(args),
|
|
36
|
+
sync: sync.parseArgs(args),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const beaconNodeOptions = {
|
|
41
|
+
...api.options,
|
|
42
|
+
...chain.options,
|
|
43
|
+
...eth1.options,
|
|
44
|
+
...execution.options,
|
|
45
|
+
...builder.options,
|
|
46
|
+
...metrics.options,
|
|
47
|
+
...monitoring.options,
|
|
48
|
+
...network.options,
|
|
49
|
+
...sync.options,
|
|
50
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {IBeaconNodeOptions, defaultOptions} from "@lodestar/beacon-node";
|
|
2
|
+
import {CliCommandOptions} from "@lodestar/utils";
|
|
3
|
+
|
|
4
|
+
export type MetricsArgs = {
|
|
5
|
+
metrics: boolean;
|
|
6
|
+
"metrics.port": number;
|
|
7
|
+
"metrics.address"?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function parseArgs(args: MetricsArgs): IBeaconNodeOptions["metrics"] {
|
|
11
|
+
return {
|
|
12
|
+
enabled: args.metrics,
|
|
13
|
+
port: args["metrics.port"],
|
|
14
|
+
address: args["metrics.address"],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const options: CliCommandOptions<MetricsArgs> = {
|
|
19
|
+
metrics: {
|
|
20
|
+
type: "boolean",
|
|
21
|
+
description: "Enable the Prometheus metrics HTTP server",
|
|
22
|
+
default: defaultOptions.metrics.enabled,
|
|
23
|
+
group: "metrics",
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"metrics.port": {
|
|
27
|
+
type: "number",
|
|
28
|
+
description: "Listen TCP port for the Prometheus metrics HTTP server",
|
|
29
|
+
default: defaultOptions.metrics.port,
|
|
30
|
+
group: "metrics",
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
"metrics.address": {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Listen address for the Prometheus metrics HTTP server",
|
|
36
|
+
defaultDescription: String(defaultOptions.metrics.address),
|
|
37
|
+
group: "metrics",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {IBeaconNodeOptions, defaultOptions} from "@lodestar/beacon-node";
|
|
2
|
+
import {CliCommandOptions} from "@lodestar/utils";
|
|
3
|
+
|
|
4
|
+
export type MonitoringArgs = {
|
|
5
|
+
"monitoring.endpoint"?: string;
|
|
6
|
+
"monitoring.interval"?: number;
|
|
7
|
+
"monitoring.initialDelay"?: number;
|
|
8
|
+
"monitoring.requestTimeout"?: number;
|
|
9
|
+
"monitoring.collectSystemStats"?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function parseArgs(args: MonitoringArgs): IBeaconNodeOptions["monitoring"] {
|
|
13
|
+
return {
|
|
14
|
+
endpoint: args["monitoring.endpoint"],
|
|
15
|
+
interval: args["monitoring.interval"],
|
|
16
|
+
initialDelay: args["monitoring.initialDelay"],
|
|
17
|
+
requestTimeout: args["monitoring.requestTimeout"],
|
|
18
|
+
collectSystemStats: args["monitoring.collectSystemStats"],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const options: CliCommandOptions<MonitoringArgs> = {
|
|
23
|
+
"monitoring.endpoint": {
|
|
24
|
+
type: "string",
|
|
25
|
+
description:
|
|
26
|
+
"Enables monitoring service for sending clients stats to the specified endpoint of a remote service (e.g. beaconcha.in)",
|
|
27
|
+
group: "monitoring",
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"monitoring.interval": {
|
|
31
|
+
type: "number",
|
|
32
|
+
description: "Interval in milliseconds between sending client stats to the remote service",
|
|
33
|
+
defaultDescription: String(defaultOptions.monitoring.interval),
|
|
34
|
+
group: "monitoring",
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"monitoring.initialDelay": {
|
|
38
|
+
type: "number",
|
|
39
|
+
description: "Initial delay in milliseconds before client stats are sent to the remote service",
|
|
40
|
+
defaultDescription: String(defaultOptions.monitoring.initialDelay),
|
|
41
|
+
group: "monitoring",
|
|
42
|
+
hidden: true,
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
"monitoring.requestTimeout": {
|
|
46
|
+
type: "number",
|
|
47
|
+
description: "Timeout in milliseconds for sending client stats to the remote service",
|
|
48
|
+
defaultDescription: String(defaultOptions.monitoring.requestTimeout),
|
|
49
|
+
group: "monitoring",
|
|
50
|
+
hidden: true,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
"monitoring.collectSystemStats": {
|
|
54
|
+
type: "boolean",
|
|
55
|
+
description:
|
|
56
|
+
"Enable collecting system stats. By default, the beacon node will collect system stats but this can also be handled by the validator client.",
|
|
57
|
+
defaultDescription: String(defaultOptions.monitoring.collectSystemStats),
|
|
58
|
+
group: "monitoring",
|
|
59
|
+
hidden: true,
|
|
60
|
+
},
|
|
61
|
+
};
|