From d2bb9f00c8e44238686c08e39c62149166893f89 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Wed, 22 Jan 2020 15:39:02 -0400 Subject: [PATCH] DO NOT MERGE ME: Need to point iohk-nix at master Update `nix/cardano-node-service.nix` Update `nix/scripts.nix` Update `nix/svclib.nix` --- cardano-node/src/Cardano/CLI/Tx/Submission.hs | 3 --- cardano-node/src/Cardano/Node/Run.hs | 4 ++-- nix/nixos/cardano-node-service.nix | 6 +++--- nix/scripts.nix | 2 +- nix/sources.json | 8 ++++---- nix/svclib.nix | 15 +++++---------- 6 files changed, 15 insertions(+), 23 deletions(-) diff --git a/cardano-node/src/Cardano/CLI/Tx/Submission.hs b/cardano-node/src/Cardano/CLI/Tx/Submission.hs index e60263aca0e..2af84945987 100644 --- a/cardano-node/src/Cardano/CLI/Tx/Submission.hs +++ b/cardano-node/src/Cardano/CLI/Tx/Submission.hs @@ -25,10 +25,7 @@ import Ouroboros.Consensus.Block (BlockProtocol) import Ouroboros.Consensus.Mempool (ApplyTxErr, GenTx) import Ouroboros.Consensus.Node.Run (RunNode) import qualified Ouroboros.Consensus.Node.Run as Node -import Ouroboros.Consensus.NodeId (NodeId(..)) import Ouroboros.Consensus.Protocol (NodeConfig) -import qualified Ouroboros.Consensus.Protocol as Consensus -import Ouroboros.Consensus.Protocol hiding (Protocol) import Network.TypedProtocol.Driver (runPeer) import Network.TypedProtocol.Codec.Cbor (Codec, DeserialiseFailure) diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index b34ea17f31b..39f89927d6e 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -193,7 +193,7 @@ handleSimpleNode p trace nodeTracers npm onKernel = do , "**************************************" ] - -- Socket directory + -- Socket path myLocalAddr <- localSocketAddrInfo $ socketFile rMscFp addrs <- nodeAddressInfo rNodeAddr @@ -297,7 +297,7 @@ handleSimpleNode p trace nodeTracers npm onKernel = do , "**************************************" ] - -- Socket directory + -- Socket path myLocalAddr <- localSocketAddrInfo $ socketFile mMscFp addrs <- nodeAddressInfo mockNodeAddress diff --git a/nix/nixos/cardano-node-service.nix b/nix/nixos/cardano-node-service.nix index cc76a4afb6a..b455cf9b8a3 100644 --- a/nix/nixos/cardano-node-service.nix +++ b/nix/nixos/cardano-node-service.nix @@ -10,7 +10,7 @@ let inherit (commonLib) svcLib; 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}" @@ -183,8 +183,8 @@ in { topology = mkOption { type = types.path; - default = commonLib.mkEdgeTopology { - inherit (cfg) nodeId port; + default = localLib.mkEdgeTopology { + inherit (cfg) port; inherit (envConfig) edgeNodes; }; description = '' diff --git a/nix/scripts.nix b/nix/scripts.nix index 107da481433..0c5f0cf6e9b 100644 --- a/nix/scripts.nix +++ b/nix/scripts.nix @@ -42,7 +42,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 = { diff --git a/nix/sources.json b/nix/sources.json index ccfc46dceae..03c5fb29ad9 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -60,15 +60,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "iohk-nix": { - "branch": "haskell-overhaul", + "branch": "jordan/update-mkEdgeTopology", "description": "nix scripts shared across projects", "homepage": null, "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "df6b4c782594aed5956b59e12de342a026170b8a", - "sha256": "0v53b8pksi99rjj5xdvv5v8dbryy2y7l7bbvzy64qq03v648kdhf", + "rev": "cfca6d9154c6b1233685160186c8674d7c7266db", + "sha256": "1i1qxfxx92nj44h2pxjqy53h7cqdiw53cl9gi3szv02qvqr8ym7p", "type": "tarball", - "url": "https://github.com/input-output-hk/iohk-nix/archive/df6b4c782594aed5956b59e12de342a026170b8a.tar.gz", + "url": "https://github.com/input-output-hk/iohk-nix/archive/cfca6d9154c6b1233685160186c8674d7c7266db.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { diff --git a/nix/svclib.nix b/nix/svclib.nix index ac55b5075ca..642169320e2 100644 --- a/nix/svclib.nix +++ b/nix/svclib.nix @@ -26,10 +26,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)); @@ -68,13 +66,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.