Skip to content

Commit

Permalink
supervisord-cluster: initial setup
Browse files Browse the repository at this point in the history
add supervisord-cluster to shell.nix

supervisord cluster: map service accross numBft and numPools

Build pools setup transaction (transfer, register, delegate).

Ignore supervisord.pid

cluster improvements

iohk-nix: back to master

stylistic changes

Fix dockerImage attr in default.nix
  • Loading branch information
disassembler authored and johnalotoski committed Jun 18, 2020
1 parent d948f9f commit a68fcd8
Show file tree
Hide file tree
Showing 12 changed files with 361 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dist/
\.#*
*.swp
.dir-locals.el
/result*
result*
/launch-*
stack.yaml.lock

Expand All @@ -28,6 +28,7 @@ stack.yaml.lock
*.stats
/cluster
/cluster.*
supervisord.pid

tags
/config
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stylish-haskell: ## Apply stylish-haskell on all *.hs files
@find . -type f -name "*.hs" -not -path '.git' -not -path '*.stack-work*' -print0 | xargs -0 stylish-haskell -i

cabal-hashes:
$$(nix-build default.nix -A checkCabalProject --no-out-link)
$$(nix-build ./nix -A iohkNix.checkCabalProject --no-out-link)

ghci: ## Run repl
@stack ghci $(PROJECT_NAME):lib --haddock-deps --ghci-options=-fobject-code --nix
Expand Down
18 changes: 6 additions & 12 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let
};
customConfig' = defaultConfig // customConfig;
in pkgs.callPackage ./nix/docker.nix {
inherit (self) cardano-node;
inherit (packages) cardano-node;
scripts = callPackage ./nix/scripts.nix { customConfig = customConfig'; };
};

Expand All @@ -54,19 +54,13 @@ let
$STRIP $out/bin/*
'' else p;

self = {
inherit haskellPackages scripts nixosTests environments dockerImage;
packages = {
inherit haskellPackages cardano-node cardano-cli chairman db-converter
scripts nixosTests environments dockerImage;

inherit (haskellPackages.cardano-node.identifier) version;
# Grab the executable component of our package.
inherit (haskellPackages.cardano-node.components.exes) cardano-node;
cardano-node-profiled = cardanoNodeProfiledHaskellPackages.cardano-node.components.exes.cardano-node;
inherit (haskellPackages.cardano-cli.components.exes) cardano-cli;
inherit (haskellPackages.cardano-node.components.exes) chairman;
# expose the db-converter from the ouroboros-network we depend on
inherit (cardanoNodeHaskellPackages.ouroboros-consensus-byron.components.exes) db-converter;

inherit (pkgs.iohkNix) checkCabalProject;
cluster = mkCluster customConfig;

exes = mapAttrsRecursiveCond (as: !(isDerivation as)) rewrite-static (collectComponents' "exes" haskellPackages);

Expand All @@ -85,4 +79,4 @@ let
withHoogle = true;
};
};
in self
in packages
10 changes: 10 additions & 0 deletions nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ pkgs: _: with pkgs; {
;
profiling = true;
};

#Grab the executable component of our package.
inherit (cardanoNodeHaskellPackages.cardano-node.components.exes) cardano-node chairman;
inherit (cardanoNodeHaskellPackages.cardano-cli.components.exes) cardano-cli;
cardano-node-profiled = cardanoNodeProfiledHaskellPackages.cardano-node.components.exes.cardano-node;

# expose the db-converter from the ouroboros-network we depend on
inherit (cardanoNodeHaskellPackages.ouroboros-consensus-byron.components.exes) db-converter;

mkCluster = callPackage ./supervisord-cluster;
}
6 changes: 3 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"homepage": null,
"owner": "input-output-hk",
"repo": "iohk-nix",
"rev": "a3eae81cbae000bbfdc2bc1880528512747a3a9c",
"sha256": "1jairn2vp43z36j0b1fi2nmnfpadff217dqv5bjjxm5v099g0gsw",
"rev": "ccad0bf9ceb3a68a837886f8032da0e70529d183",
"sha256": "0hyzqbws8j1bvkb4m0ngck7mgs41p2wp9gy6ncvx1pf2svwz9916",
"type": "tarball",
"url": "https://github.com/input-output-hk/iohk-nix/archive/a3eae81cbae000bbfdc2bc1880528512747a3a9c.tar.gz",
"url": "https://github.com/input-output-hk/iohk-nix/archive/ccad0bf9ceb3a68a837886f8032da0e70529d183.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
23 changes: 23 additions & 0 deletions nix/supervisord-cluster/base-env.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
defaultLogConfig
, stateDir
}:

rec {
inherit stateDir;
useByronWallet = true;
relaysNew = "127.0.0.1";
edgePort = 3001;
confKey = "local";
private = false;
networkConfig = {
GenesisFile = "keys/genesis.json";
Protocol = "TPraos";
RequiresNetworkMagic = "RequiresMagic";
LastKnownBlockVersion-Major = 0;
LastKnownBlockVersion-Minor = 0;
LastKnownBlockVersion-Alt = 0;
};
nodeConfig = networkConfig // defaultLogConfig;
consensusProtocol = networkConfig.Protocol;
}
Loading

0 comments on commit a68fcd8

Please sign in to comment.