Skip to content

Commit

Permalink
chairmans-cluster: update the test to node CLI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Feb 17, 2020
1 parent 77a2111 commit a376106
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions nix/nixos/cardano-node-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ let
envConfig = cfg.environments.${cfg.environment}; systemdServiceName = "cardano-node${optionalString cfg.instanced "@"}";
mkScript = cfg:
let exec = "cardano-node run";
runtimeDir = if cfg.runtimeDir == null then cfg.stateDir else "/run/${cfg.runtimeDir}";
cmd = builtins.filter (x: x != "") [
"${cfg.package}/bin/${exec}"
"--genesis-file ${cfg.genesisFile}"
"--genesis-hash ${cfg.genesisHash}"
"--config ${cfg.nodeConfigFile}"
"--database-path ${cfg.databasePath}"
"--socket-path ${if (cfg.runtimeDir == null) then "${cfg.stateDir}/socket" else "/run/${cfg.runtimeDir}"}"
"--socket-path ${runtimeDir}/node-$1.socket"
"--topology ${cfg.topology}"
"--host-addr ${cfg.hostAddr}"
"--port ${toString cfg.port}"
Expand All @@ -31,7 +32,7 @@ let
echo "Starting ${exec}: ${concatStringsSep "\"\n echo \"" cmd}"
echo "..or, once again, in a single line:"
echo "${toString cmd}"
ls -l ${if (cfg.runtimeDir == null) then "${cfg.stateDir}/socket" else "/run/${cfg.runtimeDir}"} || true
ls -l ${runtimeDir} || true
exec ${toString cmd}'';
in {
options = {
Expand Down
8 changes: 4 additions & 4 deletions nix/nixos/chairman-as-a-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ let
inherit (chairmanConfig) timeout maxBlockNo k slot-length node-ids nodeConfigFile nodeConfig timeoutIsSuccess;
};
mkScript = cfg:
let nodeIdArgs = builtins.toString
(map (i: "--core-node-id ${toString i}")
let runtimeDir = if ncfg.runtimeDir == null then ncfg.stateDir else "/run/${ncfg.runtimeDir}";
socketArgs = builtins.toString
(map (i: "--socket-path ${runtimeDir}/node-${toString i}.socket")
cfg.node-ids);
exec = "chairman";
cmd = [
"${chairman}/bin/chairman"
(nodeIdArgs)
(socketArgs)
"--timeout ${toString cfg.timeout}"
"--max-block-no ${toString cfg.maxBlockNo}"
"--security-param ${toString cfg.k}"
"--genesis-file ${cfg.genesisFile}"
"--genesis-hash ${cfg.genesisHash}"
"--socket-path ${if (ncfg.runtimeDir == null) then "${ncfg.stateDir}/socket" else "/run/${ncfg.runtimeDir}"}"
"--config ${cfg.nodeConfigFile}"
"${optionalString cfg.timeoutIsSuccess "--timeout-is-success"}"
];
Expand Down

0 comments on commit a376106

Please sign in to comment.