Skip to content

Commit

Permalink
nixos node svc: usePeersFromLedgerAfterSlot -> useLedgerAfterSlot
Browse files Browse the repository at this point in the history
* Update usePeersFromLedgerAfterSlot to useLedgerAfterSlot for
  consistent naming with the cardano-node topology file key.
  • Loading branch information
johnalotoski committed Feb 28, 2025
1 parent f101bb0 commit debf5e8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions nix/nixos/cardano-node-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ let
advertise = g.advertise or false;
}) (cfg.publicProducers ++ (cfg.instancePublicProducers i));
bootstrapPeers = cfg.bootstrapPeers;
} // optionalAttrs (cfg.usePeersFromLedgerAfterSlot != null) {
useLedgerAfterSlot = cfg.usePeersFromLedgerAfterSlot;
} // optionalAttrs (cfg.useLedgerAfterSlot != null) {
useLedgerAfterSlot = cfg.useLedgerAfterSlot;
} // optionalAttrs (cfg.peerSnapshotFile i != null) {
peerSnapshotFile = cfg.peerSnapshotFile i;
};
Expand Down Expand Up @@ -167,6 +167,12 @@ let
''}
${toString cmd}'';
in {
imports = [
# Update the option name for consistency with the cardano-node topology file key.
(mkRenamedOptionModule
[ "services" "cardano-node" "usePeersFromLedgerAfterSlot" ] [ "services" "cardano-node" "useLedgerAfterSlot" ])
];

options = {
services.cardano-node = {
enable = mkOption {
Expand Down Expand Up @@ -528,7 +534,7 @@ in {
}];
description = ''
Routes to public peers. Only used if slot is less than
usePeersFromLedgerAfterSlot.
useLedgerAfterSlot.
'';
};

Expand All @@ -537,7 +543,7 @@ in {
default = _: [];
description = ''
Routes to public peers. Only used if slot is less than
usePeersFromLedgerAfterSlot and specific to a given instance when
useLedgerAfterSlot and specific to a given instance when
multiple instances are used.
'';
};
Expand Down Expand Up @@ -581,10 +587,10 @@ in {
'';
};

usePeersFromLedgerAfterSlot = mkOption {
useLedgerAfterSlot = mkOption {
type = types.nullOr types.int;
default = if cfg.kesKey != null then null
else envConfig.usePeersFromLedgerAfterSlot or null;
else envConfig.useLedgerAfterSlot or null;
description = ''
If set, bootstraps from public roots until it reaches given slot,
then it switches to using the ledger as a source of peers. It
Expand Down

0 comments on commit debf5e8

Please sign in to comment.