Skip to content

Commit

Permalink
Adds genesisAddrSelector option for faucet role usage
Browse files Browse the repository at this point in the history
  • Loading branch information
johnalotoski committed Nov 14, 2019
1 parent f005df6 commit b6f8ad4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion nixos/jormungandr-monitor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ in {
description = "Extract addresses to monitor from this file if set";
};

genesisAddrSelector = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
A specific single address to monitor from the genesis yaml list (1-indexed).
If the genesisYaml option is utilized and this genesisAddrSelector is not
provided, the full list of addresses will be monitored.
'';
};

port = mkOption {
type = types.port;
default = 8000;
Expand All @@ -52,7 +62,11 @@ in {
PORT = toString cfg.port;
JORMUNGANDR_API = cfg.jormungandrApi;
MONITOR_ADDRESSES = concatStringsSep " "
((optionals (cfg.genesisYaml != null) genesisAddresses)
((optionals (cfg.genesisYaml != null) (
if (cfg.genesisAddrSelector != null) then
[ (__elemAt genesisAddresses (cfg.genesisAddrSelector - 1)) ]
else
genesisAddresses))
++ cfg.monitorAddresses);
};

Expand Down

0 comments on commit b6f8ad4

Please sign in to comment.