Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge #22
Browse files Browse the repository at this point in the history
22: Add nodeId parameter to byron-proxy script and nixos service r=disassembler a=disassembler



Co-authored-by: Samuel Leathers <samuel.leathers@iohk.io>
  • Loading branch information
iohk-bors[bot] and disassembler committed Aug 14, 2019
2 parents c763433 + eab2c4c commit 76b5abc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nix/byron-proxy-scripts.nix
Expand Up @@ -17,13 +17,14 @@ let
config = {
proxyHost = "127.0.0.1";
proxyPort = 7777;
nodeId = null;
topologyFile = mkTopology envConfig.relays;
loggingConfig = ../cfg/logging.yaml;
pbftThreshold = null;
} // envConfig
// customConfig;
in with config; pkgs.writeScript "byron-proxy-${environment}" ''
exec ${byronProxy}/bin/cardano-byron-proxy +RTS -T -RTS --database-path db-byron-proxy-${environment} --index-path index-byron-proxy-${environment} --configuration-file ${configuration}/lib/configuration.yaml --configuration-key ${envConfig.confKey} --topology ${topologyFile} --logger-config ${loggingConfig} --local-addr [${proxyHost}]:${toString proxyPort} ${lib.optionalString (pbftThreshold != null) "--pbft-threshold ${pbftThreshold}"}
exec ${byronProxy}/bin/cardano-byron-proxy +RTS -T -RTS --database-path db-byron-proxy-${environment} --index-path index-byron-proxy-${environment} --configuration-file ${configuration}/lib/configuration.yaml --configuration-key ${envConfig.confKey} --topology ${topologyFile} --logger-config ${loggingConfig} --local-addr [${proxyHost}]:${toString proxyPort} ${lib.optionalString (pbftThreshold != null) "--pbft-threshold ${pbftThreshold}"} ${lib.optionalString (nodeId != null) "--node-id ${nodeId}"}
'';
configuration = cardanoConfig;

Expand Down
8 changes: 6 additions & 2 deletions nix/nixos/byron-proxy.nix
Expand Up @@ -17,9 +17,13 @@ in {
default = 7777;
};
proxyHost = mkOption {
type = types.string;
type = types.str;
default = "127.0.0.1";
};
nodeId = mkOption {
type = types.nullOr types.str;
default = null;
};
topologyFile = mkOption {
type = types.nullOr types.path;
default = null;
Expand Down Expand Up @@ -47,7 +51,7 @@ in {
wantedBy = [ "multi-user.target" ];
script = let
customConfig = {
inherit (cfg) proxyHost proxyPort;
inherit (cfg) proxyHost proxyPort nodeId;
} // lib.optionalAttrs (cfg.topologyFile != null) { inherit (cfg) topologyFile; };
byronScripts = (import ../.. { inherit customConfig; }).scripts.byron;
in ''${byronScripts.proxy.${cfg.environment}}'';
Expand Down

0 comments on commit 76b5abc

Please sign in to comment.