Skip to content

Commit

Permalink
Update nix/cardano-node-service.nix
Browse files Browse the repository at this point in the history
Update `nix/svclib.nix`
  • Loading branch information
Jimbo4350 committed Jan 24, 2020
1 parent a7e324b commit 41baaf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nix/nixos/cardano-node-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let
svcLib = (import ../svclib.nix { inherit pkgs; cardano-node = pkgs.cardano-node; });
envConfig = cfg.environments.${cfg.environment}; systemdServiceName = "cardano-node${optionalString cfg.instanced "@"}";
mkScript = cfg:
let exec = "cardano-node";
let exec = "cardano-node run";
cmd = builtins.filter (x: x != "") [
"${cfg.package}/bin/${exec}"
"--genesis-file ${cfg.genesisFile}"
Expand Down Expand Up @@ -184,7 +184,7 @@ in {
topology = mkOption {
type = types.path;
default = localLib.mkEdgeTopology {
inherit (cfg) nodeId port;
inherit (cfg) port;
inherit (envConfig) edgeNodes;
};
description = ''
Expand Down
15 changes: 5 additions & 10 deletions nix/svclib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ let
addr = host-addr;
ports = map (x: port-base + x) (range 0 (node-count - 1));
mkPeer = port: { inherit addr port valency; };
mkNodeTopo = nodeId: port: {
inherit nodeId;
nodeAddress = { inherit addr port; };
producers = map mkPeer (remove port ports);
mkNodeTopo = port : {
Producers = map mkPeer (remove port ports);
};
in toFile "topology.json" (toJSON (imap0 mkNodeTopo ports));

Expand Down Expand Up @@ -67,13 +65,10 @@ let
## we choose not to spread ports for this topology
shelley-ids = range node-id-base (node-id-base + node-count - 1);
mkPeer = id: { inherit valency; port = port-base + id; addr = addr-fn id; };
mkShelleyNode = id: {
nodeId = id;
nodeAddress = { port = port-base + id; addr = addr-fn id; };
producers = map (mkPeer) (remove id shelley-ids) ++
[ { inherit valency; port = proxy-port; addr = proxy-addr; } ];
mkShelleyNode = {
Producers = map (mkPeer) (remove id shelley-ids);
};
topology = map mkShelleyNode shelley-ids;
topology = mkShelleyNode;
in toFile "topology.yaml" (toJSON topology);

# Note how some values are literal strings, and some integral.
Expand Down

0 comments on commit 41baaf3

Please sign in to comment.