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 Feb 3, 2020
1 parent 4f2a986 commit d2bb9f0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
3 changes: 0 additions & 3 deletions cardano-node/src/Cardano/CLI/Tx/Submission.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cardano-node/src/Cardano/Node/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ handleSimpleNode p trace nodeTracers npm onKernel = do
, "**************************************"
]

-- Socket directory
-- Socket path
myLocalAddr <- localSocketAddrInfo $ socketFile rMscFp

addrs <- nodeAddressInfo rNodeAddr
Expand Down Expand Up @@ -297,7 +297,7 @@ handleSimpleNode p trace nodeTracers npm onKernel = do
, "**************************************"
]

-- Socket directory
-- Socket path
myLocalAddr <- localSocketAddrInfo $ socketFile mMscFp

addrs <- nodeAddressInfo mockNodeAddress
Expand Down
6 changes: 3 additions & 3 deletions nix/nixos/cardano-node-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion nix/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
8 changes: 4 additions & 4 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.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/<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 @@ -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));

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d2bb9f0

Please sign in to comment.