Skip to content

Commit

Permalink
config(modules/nimbus-eth2): Make web3-signer-url list of string
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNikov authored and PetarKirov committed Feb 15, 2024
1 parent 02767e1 commit 771a17f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions modules/nimbus-eth2/args.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ with lib; {
};

web3-signer-url = mkOption {
type = types.nullOr types.str;
default = null;
example = "http://localhost:9000/";
type = types.listOf types.str;
default = [];
example = ["http://localhost:9000/"];
description = mdDoc "Remote Web3Signer URL that will be used as a source of validators.";
};

Expand Down
8 changes: 7 additions & 1 deletion modules/nimbus-eth2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ in {
then ''--web3-url=${concatStringsSep " --web3-url=" cfg.args.web3-urls}''
else "";

web3SignerUrls = lib.pipe cfg.args.web3-signer-url [
(builtins.map (x: "--web3-signer-url=${x}"))
(builtins.concatStringsSep " ")
];

payloadBuilder =
if cfg.args.payload-builder.enable
then "--payload-builder=true --payload-builder-url=${cfg.args.payload-builder.url}"
Expand Down Expand Up @@ -139,12 +144,13 @@ in {
inherit pathReducer;
};
# filter out certain args which need to be treated differently
specialArgs = ["--network" "--jwt-secret" "--web3-urls" "--trusted-node-url" "--backfill" "--payload-builder" "--keymanager-token-file"];
specialArgs = ["--network" "--jwt-secret" "--web3-urls" "--web3-signer-url" "--trusted-node-url" "--backfill" "--payload-builder" "--keymanager-token-file"];
isNormalArg = name: (findFirst (arg: hasPrefix arg name) null specialArgs) == null;
filteredArgs = builtins.filter isNormalArg args;
in ''
${network} ${jwtSecret} \
${web3Url} \
${web3SignerUrls} \
${dataDir} \
${keymanagerTokenFile} \
${payloadBuilder} \
Expand Down

0 comments on commit 771a17f

Please sign in to comment.