Skip to content

Commit

Permalink
DO NOT MERGE ME: Need to point iohk-nix at master
Browse files Browse the repository at this point in the history
Update `nix/cardano-node-service.nix`
Update `nix/scripts.nix`
Update `nix/svclib.nix`
  • Loading branch information
Jimbo4350 committed Jan 24, 2020
1 parent a7e324b commit bcecc7f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 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
2 changes: 1 addition & 1 deletion nix/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let
edgeHost = if config.useProxy then config.proxyHost else config.edgeHost;
edgeNodes = if config.useProxy then [] else config.edgeNodes;
in config.topologyFile or commonLib.mkEdgeTopology {
inherit (config) hostAddr port nodeId;
inherit (config) hostAddr port;
inherit edgeNodes edgeHost edgePort;
};
serviceConfig = {
Expand Down
8 changes: 4 additions & 4 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"iohk-nix": {
"branch": "master",
"branch": "jordan/update-mkEdgeTopology",
"description": "nix scripts shared across projects",
"homepage": null,
"owner": "input-output-hk",
"repo": "iohk-nix",
"rev": "e4a53fa76c111393481d5739f0d7d10782f3cfcb",
"sha256": "1h5jd10pb8a7n18m5f123imw7nzikpawp3vbqsmhysmfazj61gpb",
"rev": "60ba229a02e941ca8aa00782d576bfb38d26100c",
"sha256": "0lchcbk144cmrd0fzmixzf7c0bw4dsv3sx45qva82wa7lria9g1j",
"type": "tarball",
"url": "https://github.com/input-output-hk/iohk-nix/archive/e4a53fa76c111393481d5739f0d7d10782f3cfcb.tar.gz",
"url": "https://github.com/input-output-hk/iohk-nix/archive/60ba229a02e941ca8aa00782d576bfb38d26100c.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
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 bcecc7f

Please sign in to comment.