git.iko.soy/typeable/nixpkgs
on master help sign in
jormungandr: Remove

This is a good example of a package/module that should be distributed externally (e.g. as a flake [1]): it's not stable yet so anybody who seriously wants to use it will want to use the upstream repo. Also, it's highly specialized so NixOS is not really the right place at the moment (every NixOS module slows down NixOS evaluation for everybody). [1] https://github.com/edolstra/jormungandr/tree/flake

commitaa98348f880052547f4035c6ce1f5403e6a91d15 authorEelco Dolstra <edolstra@gmail.com> dateTue 5 Nov 2019, 14:57 (7 years ago) parent3c8f637
6 files changed−239
nixos/modules/module-list.nix−1 nixos/modules/services/networking/jormungandr.nix−102 nixos/tests/all-tests.nix−1 nixos/tests/jormungandr.nix−77 pkgs/applications/blockchains/jormungandr/default.nix−56 pkgs/top-level/all-packages.nix−2
nixos/modules/module-list.nix−1
@@ -620,7 +620,6 @@
620620 ./services/networking/iodine.nix
621621 ./services/networking/iperf3.nix
622622 ./services/networking/ircd-hybrid/default.nix
623− ./services/networking/jormungandr.nix
624623 ./services/networking/iwd.nix
625624 ./services/networking/keepalived/default.nix
626625 ./services/networking/keybase.nix
nixos/modules/services/networking/jormungandr.nixdeleted−102
@@ -1,102 +0,0 @@
1−{ config, lib, pkgs, ... }:
2−
3−let
4− cfg = config.services.jormungandr;
5−
6− inherit (lib) mkEnableOption mkIf mkOption;
7− inherit (lib) optionalString types;
8−
9− dataDir = "/var/lib/jormungandr";
10−
11− # Default settings so far, as the service matures we will
12− # move these out as separate settings
13− configSettings = {
14− storage = dataDir;
15− p2p = {
16− public_address = "/ip4/127.0.0.1/tcp/8299";
17− topics_of_interest = {
18− messages = "high";
19− blocks = "high";
20− };
21− };
22− rest = {
23− listen = "127.0.0.1:8607";
24− };
25− };
26−
27− configFile = if cfg.configFile == null then
28− pkgs.writeText "jormungandr.yaml" (builtins.toJSON configSettings)
29− else cfg.configFile;
30−
31−in {
32−
33− options = {
34−
35− services.jormungandr = {
36− enable = mkEnableOption "jormungandr service";
37−
38− configFile = mkOption {
39− type = types.nullOr types.path;
40− default = null;
41− example = "/var/lib/jormungandr/node.yaml";
42− description = ''
43− The path of the jormungandr blockchain configuration file in YAML format.
44− If no file is specified, a file is generated using the other options.
45− '';
46− };
47−
48− secretFile = mkOption {
49− type = types.nullOr types.path;
50− default = null;
51− example = "/etc/secret/jormungandr.yaml";
52− description = ''
53− The path of the jormungandr blockchain secret node configuration file in
54− YAML format. Do not store this in nix store!
55− '';
56− };
57−
58− genesisBlockHash = mkOption {
59− type = types.nullOr types.str;
60− default = null;
61− example = "d70495af81ae8600aca3e642b2427327cb6001ec4d7a0037e96a00dabed163f9";
62− description = ''
63− Set the genesis block hash (the hash of the block0) so we can retrieve
64− the genesis block (and the blockchain configuration) from the existing
65− storage or from the network.
66− '';
67− };
68−
69− genesisBlockFile = mkOption {
70− type = types.nullOr types.path;
71− default = null;
72− example = "/var/lib/jormungandr/block-0.bin";
73− description = ''
74− The path of the genesis block file if we are hosting it locally.
75− '';
76− };
77−
78− };
79− };
80−
81− config = mkIf cfg.enable {
82−
83− systemd.services.jormungandr = {
84− description = "jormungandr server";
85− wantedBy = [ "multi-user.target" ];
86− after = [ "network-online.target" ];
87− environment = {
88− RUST_BACKTRACE = "full";
89− };
90− serviceConfig = {
91− DynamicUser = true;
92− StateDirectory = baseNameOf dataDir;
93− ExecStart = ''
94− ${pkgs.jormungandr}/bin/jormungandr --config ${configFile} \
95− ${optionalString (cfg.secretFile != null) " --secret ${cfg.secretFile}"} \
96− ${optionalString (cfg.genesisBlockHash != null) " --genesis-block-hash ${cfg.genesisBlockHash}"} \
97− ${optionalString (cfg.genesisBlockFile != null) " --genesis-block ${cfg.genesisBlockFile}"}
98− '';
99− };
100− };
101− };
102−}
nixos/tests/all-tests.nix−1
@@ -135,7 +135,6 @@ in
135135 jackett = handleTest ./jackett.nix {};
136136 jellyfin = handleTest ./jellyfin.nix {};
137137 jenkins = handleTest ./jenkins.nix {};
138− jormungandr = handleTest ./jormungandr.nix {};
139138 kafka = handleTest ./kafka.nix {};
140139 kerberos = handleTest ./kerberos/default.nix {};
141140 kernel-latest = handleTest ./kernel-latest.nix {};
nixos/tests/jormungandr.nixdeleted−77
@@ -1,77 +0,0 @@
1−import ./make-test.nix ({ pkgs, ... }: {
2− name = "jormungandr";
3− meta = with pkgs.stdenv.lib.maintainers; {
4− maintainers = [ mmahut ];
5− };
6−
7− nodes = {
8− # Testing the Byzantine Fault Tolerant protocol
9− bft = { ... }: {
10− environment.systemPackages = [ pkgs.jormungandr ];
11− services.jormungandr.enable = true;
12− services.jormungandr.genesisBlockFile = "/var/lib/jormungandr/block-0.bin";
13− services.jormungandr.secretFile = "/etc/secrets/jormungandr.yaml";
14− };
15−
16− # Testing the Ouroboros Genesis Praos protocol
17− genesis = { ... }: {
18− environment.systemPackages = [ pkgs.jormungandr ];
19− services.jormungandr.enable = true;
20− services.jormungandr.genesisBlockFile = "/var/lib/jormungandr/block-0.bin";
21− services.jormungandr.secretFile = "/etc/secrets/jormungandr.yaml";
22− };
23− };
24−
25− testScript = ''
26− startAll;
27−
28− ## Testing BFT
29− # Let's wait for the StateDirectory
30− $bft->waitForFile("/var/lib/jormungandr/");
31−
32− # First, we generate the genesis file for our new blockchain
33− $bft->succeed("jcli genesis init > /root/genesis.yaml");
34−
35− # We need to generate our secret key
36− $bft->succeed("jcli key generate --type=Ed25519 > /root/key.prv");
37−
38− # We include the secret key into our services.jormungandr.secretFile
39− $bft->succeed("mkdir -p /etc/secrets");
40− $bft->succeed("echo -e \"bft:\\n signing_key:\" \$(cat /root/key.prv) > /etc/secrets/jormungandr.yaml");
41−
42− # After that, we generate our public key from it
43− $bft->succeed("cat /root/key.prv | jcli key to-public > /root/key.pub");
44−
45− # We add our public key as a consensus leader in the genesis configration file
46− $bft->succeed("sed -ie \"s/ed25519_pk1vvwp2s0n5jl5f4xcjurp2e92sj2awehkrydrlas4vgqr7xzt33jsadha32/\$(cat /root/key.pub)/\" /root/genesis.yaml");
47−
48− # Now we can generate the genesis block from it
49− $bft->succeed("jcli genesis encode --input /root/genesis.yaml --output /var/lib/jormungandr/block-0.bin");
50−
51− # We should have everything to start the service now
52− $bft->succeed("systemctl restart jormungandr");
53− $bft->waitForUnit("jormungandr.service");
54−
55− # Now we can test if we are able to reach the REST API
56− $bft->waitUntilSucceeds("curl -L http://localhost:8607/api/v0/node/stats | grep uptime");
57−
58− ## Testing Genesis
59− # Let's wait for the StateDirectory
60− $genesis->waitForFile("/var/lib/jormungandr/");
61−
62− # Bootstraping the configuration
63− $genesis->succeed("jormungandr-bootstrap -g -p 8607 -s 1");
64−
65− # Moving generated files in place
66− $genesis->succeed("mkdir -p /etc/secrets");
67− $genesis->succeed("mv pool-secret1.yaml /etc/secrets/jormungandr.yaml");
68− $genesis->succeed("mv block-0.bin /var/lib/jormungandr/");
69−
70− # We should have everything to start the service now
71− $genesis->succeed("systemctl restart jormungandr");
72− $genesis->waitForUnit("jormungandr.service");
73−
74− # Now we can create and delegate an account
75− $genesis->succeed("./create-account-and-delegate.sh | tee -a /tmp/delegate.log");
76− '';
77−})
pkgs/applications/blockchains/jormungandr/default.nixdeleted−56
@@ -1,56 +0,0 @@
1−{ stdenv
2−, lib
3−, fetchgit
4−, rustPlatform
5−, openssl
6−, pkgconfig
7−, protobuf
8−, darwin
9−}:
10−
11−rustPlatform.buildRustPackage rec {
12− pname = "jormungandr";
13− version = "0.7.0-rc4";
14−
15− src = fetchgit {
16− url = "https://github.com/input-output-hk/${pname}";
17− rev = "v${version}";
18− sha256 = "1cjdapy0r2bikqck64cl09vzs307wcfi628hfmpczrg33i81pr3g";
19− fetchSubmodules = true;
20− };
21−
22− cargoSha256 = "0546ahgwcczaxda1hc1r20skzi93s40isq2ys40y9165sgdydn4i";
23−
24− nativeBuildInputs = [ pkgconfig protobuf ];
25− buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
26−
27− patchPhase = ''
28− sed -i "s~SCRIPTPATH=.*~SCRIPTPATH=$out/templates/~g" scripts/bootstrap
29− '';
30−
31− installPhase = ''
32− install -d $out/bin $out/templates
33− install -m755 target/*/release/jormungandr $out/bin/
34− install -m755 target/*/release/jcli $out/bin/
35− install -m755 target/*/release/jormungandr-scenario-tests $out/bin/
36− install -m755 scripts/send-transaction $out/templates
37− install -m755 scripts/jcli-helpers $out/bin/
38− install -m755 scripts/bootstrap $out/bin/jormungandr-bootstrap
39− install -m644 scripts/faucet-send-money.shtempl $out/templates/
40− install -m644 scripts/create-account-and-delegate.shtempl $out/templates/
41− install -m644 scripts/faucet-send-certificate.shtempl $out/templates/
42− '';
43−
44− PROTOC = "${protobuf}/bin/protoc";
45−
46− # Disabling integration tests
47− doCheck = false;
48−
49− meta = with stdenv.lib; {
50− description = "An aspiring blockchain node";
51− homepage = "https://input-output-hk.github.io/jormungandr/";
52− license = licenses.mit;
53− maintainers = [ maintainers.mmahut ];
54− platforms = platforms.all;
55− };
56−}
pkgs/top-level/all-packages.nix−2
@@ -22175,8 +22175,6 @@ in
2217522175 inherit (darwin.apple_sdk.frameworks) IOKit;
2217622176 };
2217722177
22178− jormungandr = callPackage ../applications/blockchains/jormungandr { };
22179−
2218022178 ledger-live-desktop = callPackage ../applications/blockchains/ledger-live-desktop { };
2218122179
2218222180 litecoin = callPackage ../applications/blockchains/litecoin.nix {