From 53b13b3cb33d5cb85bdabc4864d9dd62e09e8fb9 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Sun, 29 Sep 2019 14:34:28 +1000 Subject: [PATCH 01/15] nix: Refactor windows release dist (cherry picked from commit 051c1d2bd000316acebf08b8b03f44087bb6b653) --- nix/jormungandr.nix | 24 ++++++++++++++++++++++-- nix/windows-release.nix | 35 +++++++++++++++++++++++++++++++++++ release.nix | 36 ++++-------------------------------- 3 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 nix/windows-release.nix diff --git a/nix/jormungandr.nix b/nix/jormungandr.nix index ecec4d67f80..fb0bcb1b40e 100644 --- a/nix/jormungandr.nix +++ b/nix/jormungandr.nix @@ -37,7 +37,27 @@ let cargoSha256 = "0pflam5am760z4pz3j1ga4arsixmay2487sgpqrhrkiaws4nxy57"; }; + windows = rec { + # URL and hash of windows binary release + url = "https://github.com/input-output-hk/jormungandr/releases/download/v${release.version}/jormungandr-v${release.version}-x86_64-pc-windows-msvc.zip"; + sha256 = "0dd2b2r50kcwakn61sv7xvf2s1yl586rlk8zch2bpfw9bjqrs0hl"; + }; + + jormungandr-win64 = pkgs.runCommand "jormungandr-win64-${release.version}" { + nativeBuildInputs = [ pkgs.buildPackages.unzip ]; + } '' + mkdir -p $out/bin + cd $out/bin + unzip ${pkgs.fetchurl windows} + ''; + + nonWindows = pkg: if pkgs.stdenv.hostPlatform.isWindows + then jormungandr-win64 + else pkg; + in { - jormungandr = iohkLib.rust-packages.pkgs.makeJormungandr release; - jormungandr-cli = iohkLib.rust-packages.pkgs.makeJcli release; + jormungandr = nonWindows (iohkLib.rust-packages.pkgs.makeJormungandr release); + jormungandr-cli = nonWindows (iohkLib.rust-packages.pkgs.makeJcli release); + + inherit jormungandr-win64; } diff --git a/nix/windows-release.nix b/nix/windows-release.nix new file mode 100644 index 00000000000..174d8b6f09e --- /dev/null +++ b/nix/windows-release.nix @@ -0,0 +1,35 @@ +{ pkgs +, cardano-wallet-jormungandr +, project +, jpkgs ? import ./jormungandr.nix { inherit pkgs; } +, jormungandr-win64 ? jpkgs.jormungandr-win64 +}: + +let + testData = ../lib/jormungandr/test/data/jormungandr; + name = "cardano-wallet-jormungandr-${project.version}-win64"; + jm-bat = pkgs.writeText "jm.bat" '' + jormungandr.exe --config config.yaml --genesis-block block0.bin --secret secret.yaml + ''; + cw-bat = pkgs.writeText "cw.bat" '' + cardano-wallet-jormungandr.exe serve --node-port 8081 --genesis-hash HASH --database c:\\cardano-wallet-jormungandr\\wallet.db + ''; +in pkgs.runCommand name { + nativeBuildInputs = [ pkgs.zip pkgs.jq pkgs.gnused project.jormungandr-cli ]; +} '' + mkdir -pv jm $out/nix-support + cd jm + + cp -v ${cardano-wallet-jormungandr}/bin/* . + cp -v ${jormungandr-win64}/bin/* . + cp -v ${testData}/block0.bin ${testData}/secret.yaml . + cp -v ${jm-bat} jm.bat + hash="$(jcli genesis hash --input block0.bin)" + sed -e "s/HASH/$hash/" ${cw-bat} > cw.bat + sed -e 's/storage:.*/storage: "c:\\\\cardano-wallet-jormungandr\\\\storage"/' \ + ${testData}/config.yaml > config.yaml + chmod -R +w . + + zip -r $out/${name}.zip . + echo "file binary-dist $out/${name}.zip" > $out/nix-support/hydra-build-products +'' diff --git a/release.nix b/release.nix index 451fe460895..957de0963de 100644 --- a/release.nix +++ b/release.nix @@ -38,38 +38,10 @@ let ] ); - cardano-wallet-jormungandr-win64 = let - jm = pkgs.fetchurl { - url = https://github.com/input-output-hk/jormungandr/releases/download/v0.3.3/jormungandr-v0.3.3-x86_64-pc-windows-msvc.zip; - sha256 = "0psva16vq86gcld701k0fi6kk1ydnm2q3yd2mdgflb0x8zpm2i3g"; - }; - testData = ./lib/jormungandr/test/data/jormungandr; - name = "cardano-wallet-jormungandr-${project.version}-win64.zip"; - jm-bat = pkgs.writeText "jm.bat" '' - jormungandr.exe --config config.yaml --genesis-block block0.bin -- --secret secret.yaml - ''; - cw-bat = pkgs.writeText "cw.bat" '' - cardano-wallet-jormungandr.exe serve --node-port 8081 --genesis-block-hash HASH --database c:\\cardano-wallet-jormungandr\\wallets - ''; - in pkgs.runCommand "cardano-wallet-jormungandr-win64" { - buildInputs = [ pkgs.zip pkgs.unzip pkgs.jq pkgs.gnused project.jormungandr-cli ]; - } '' - mkdir -pv jm $out/nix-support - cd jm - - cp -v ${jobs.x86_64-pc-mingw32.cardano-wallet-jormungandr.x86_64-linux}/bin/* . - unzip ${jm} - cp -v ${testData}/block0.bin ${testData}/secret.yaml . - cp -v ${jm-bat} jm.bat - hash="$(jcli genesis hash --input block0.bin)" - sed -e "s/HASH/$hash/" ${cw-bat} > cw.bat - sed -e 's/storage:.*/storage: "c:\\\\cardano-wallet-jormungandr\\\\storage"/' \ - ${testData}/config.yaml > config.yaml - chmod -R +w . - - zip -r $out/${name} . - echo "file binary-dist $out/${name}" > $out/nix-support/hydra-build-products - ''; + cardano-wallet-jormungandr-win64 = import ./nix/windows-release.nix { + inherit pkgs project; + cardano-wallet-jormungandr = jobs.x86_64-pc-mingw32.cardano-wallet-jormungandr.x86_64-linux; + }; } # Build the shell derivation in Hydra so that all its dependencies # are cached. From 6d353be92fe7ead5920f2436de6289031dac4e36 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Fri, 11 Oct 2019 20:22:05 -0400 Subject: [PATCH 02/15] switch to niv/19.09 --- default.nix | 2 +- lib.nix | 9 +++ nix/.stack.nix/default.nix | 14 ++++ nix/iohk-common.nix | 14 ---- nix/jormungandr.nix | 2 +- nix/regenerate.sh | 2 +- nix/sources.json | 50 ++++++++++++++ nix/sources.nix | 130 +++++++++++++++++++++++++++++++++++++ nix/windows-release.nix | 3 +- release.nix | 2 +- 10 files changed, 208 insertions(+), 20 deletions(-) create mode 100644 lib.nix delete mode 100644 nix/iohk-common.nix create mode 100644 nix/sources.json create mode 100644 nix/sources.nix diff --git a/default.nix b/default.nix index 884bc93e050..583afbe7f09 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ , crossSystem ? null , config ? {} # Import IOHK common nix lib -, iohkLib ? import ./nix/iohk-common.nix { inherit system crossSystem config; } +, iohkLib ? import ./lib.nix { inherit system crossSystem config; } # Use nixpkgs pin from iohkLib , pkgs ? iohkLib.pkgs }: diff --git a/lib.nix b/lib.nix new file mode 100644 index 00000000000..4a0779931d2 --- /dev/null +++ b/lib.nix @@ -0,0 +1,9 @@ +{ ... }@args: + +let + sources = import ./nix/sources.nix; + iohkNix = import sources.iohk-nix (args // { nixpkgsOverride = import sources.nixpkgs args; }); +in +iohkNix.pkgs.lib // iohkNix // { + inherit sources; +} diff --git a/nix/.stack.nix/default.nix b/nix/.stack.nix/default.nix index 45cf8f36a7a..13024328622 100644 --- a/nix/.stack.nix/default.nix +++ b/nix/.stack.nix/default.nix @@ -44,6 +44,20 @@ }; }) { packages = {}; } + { + packages = { + "iohk-monitoring" = { + flags = { + "disable-examples" = true; + "disable-ekg" = true; + "disable-systemd" = true; + "disable-prometheus" = true; + "disable-gui" = true; + "disable-graylog" = true; + }; + }; + }; + } ]; compiler = "ghc-8.6.5"; } \ No newline at end of file diff --git a/nix/iohk-common.nix b/nix/iohk-common.nix deleted file mode 100644 index 10edbfaf504..00000000000 --- a/nix/iohk-common.nix +++ /dev/null @@ -1,14 +0,0 @@ -# Imports the iohk-nix library. -# The version can be overridden for debugging purposes by setting -# NIX_PATH=iohk_nix=/path/to/iohk-nix -import ( - let try = builtins.tryEval ; - in if try.success - then builtins.trace "using host " try.value - else - let - spec = builtins.fromJSON (builtins.readFile ./iohk-nix-src.json); - in builtins.fetchTarball { - url = "${spec.url}/archive/${spec.rev}.tar.gz"; - inherit (spec) sha256; - }) diff --git a/nix/jormungandr.nix b/nix/jormungandr.nix index fb0bcb1b40e..b2883436dbe 100644 --- a/nix/jormungandr.nix +++ b/nix/jormungandr.nix @@ -22,7 +22,7 @@ # ############################################################################ -{ iohkLib ? import ./iohk-common.nix {} +{ iohkLib ? import ../lib.nix {} , pkgs ? iohkLib.pkgs }: diff --git a/nix/regenerate.sh b/nix/regenerate.sh index cad4a13b4c1..981cf30e728 100755 --- a/nix/regenerate.sh +++ b/nix/regenerate.sh @@ -2,4 +2,4 @@ set -euo pipefail -exec $(nix-build `dirname $0`/iohk-common.nix -A nix-tools.regeneratePackages --no-out-link) +exec $(nix-build `dirname $0`/../lib.nix -A nix-tools.regeneratePackages --no-out-link) diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 00000000000..e39c37224e0 --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,50 @@ +{ + "gitignore": { + "branch": "master", + "description": "Nix function for filtering local git sources", + "homepage": "", + "owner": "hercules-ci", + "repo": "gitignore", + "rev": "f9e996052b5af4032fe6150bba4a6fe4f7b9d698", + "sha256": "0jrh5ghisaqdd0vldbywags20m2cxpkbbk5jjjmwaw0gr8nhsafv", + "type": "tarball", + "url": "https://github.com/hercules-ci/gitignore/archive/f9e996052b5af4032fe6150bba4a6fe4f7b9d698.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "iohk-nix": { + "branch": "niv-snappy-choco", + "description": "nix scripts shared across projects", + "homepage": null, + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "e12c8b0d56e9a776a0a4e06614ee3f631e209084", + "sha256": "1byl96cms33da5hil53sbw5bzss6zzga5vvf2lin2df8i2kg6bhh", + "type": "tarball", + "url": "https://github.com/input-output-hk/iohk-nix/archive/e12c8b0d56e9a776a0a4e06614ee3f631e209084.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "niv": { + "branch": "iohk", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "input-output-hk", + "repo": "niv", + "rev": "4229fbcf62997467c34283a2f353702359e78e5a", + "sha256": "1y1h6aj0rxrrhvp9jpr6xw3zsa1l8ac25ng4xzjskr5kg620pxqr", + "type": "tarball", + "url": "https://github.com/input-output-hk/niv/archive/4229fbcf62997467c34283a2f353702359e78e5a.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "nixos-19.09", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs-channels", + "rev": "88f32cca5a47b788556c00c7057d09ef083d3bfb", + "sha256": "0my931ilq66983bfr9k4s6j911a3mgwqmjbyd45w54xb68bcirba", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/88f32cca5a47b788556c00c7057d09ef083d3bfb.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 00000000000..b7be13a8a7e --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,130 @@ +# This file has been generated by Niv. + +# A record, from name to path, of the third-party packages +with rec +{ + pkgs = + if hasNixpkgsPath + then + if hasThisAsNixpkgsPath + then import (builtins_fetchTarball { inherit (sources_nixpkgs) url sha256; }) {} + else import {} + else + import (builtins_fetchTarball { inherit (sources_nixpkgs) url sha256; }) {}; + + sources_nixpkgs = + if builtins.hasAttr "nixpkgs" sources + then sources.nixpkgs + else abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + sources_gitignore = + if builtins.hasAttr "gitignore" sources + then sources.gitignore + else abort + '' + Please add "gitignore" to your sources.json: + niv add hercules-ci/gitignore + ''; + + inherit (import (builtins_fetchTarball { inherit (sources_gitignore) url sha256; }) { + inherit (pkgs) lib; + }) gitignoreSource; + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = + { url, sha256 ? null }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if sha256 == null || lessThan nixVersion "1.12" then + fetchTarball { inherit url; } + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = + { url, sha256 ? null }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if sha256 == null || lessThan nixVersion "1.12" then + fetchurl { inherit url; } + else + fetchurl attrs; + + # A wrapper around pkgs.fetchzip that has inspectable arguments, + # annoyingly this means we have to specify them + fetchzip = { url, sha256 ? null }@attrs: if sha256 == null + then builtins.fetchTarball { inherit url; } + else pkgs.fetchzip attrs; + + # A wrapper around pkgs.fetchurl that has inspectable arguments, + # annoyingly this means we have to specify them + fetchurl = { url, sha256 }@attrs: pkgs.fetchurl attrs; + + hasNixpkgsPath = (builtins.tryEval ).success; + hasThisAsNixpkgsPath = + (builtins.tryEval ).success && == ./.; + + sources = builtins.fromJSON (builtins.readFile ./sources.json); + + mapAttrs = builtins.mapAttrs or + (f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))); + + # borrowed from nixpkgs + functionArgs = f: f.__functionArgs or (builtins.functionArgs f); + callFunctionWith = autoArgs: f: args: + let auto = builtins.intersectAttrs (functionArgs f) autoArgs; + in f (auto // args); + + getFetcher = spec: + let fetcherName = + if builtins.hasAttr "type" spec + then builtins.getAttr "type" spec + else "builtin-tarball"; + in builtins.getAttr fetcherName { + "tarball" = fetchzip; + "builtin-tarball" = builtins_fetchTarball; + "file" = fetchurl; + "builtin-url" = builtins_fetchurl; + }; +}; +# NOTE: spec must _not_ have an "outPath" attribute +mapAttrs (name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + let + host = if (name == "nixpkgs") then "custom_nixpkgs" else name; + tryFromPath = builtins.tryEval (builtins.findFile builtins.nixPath host); + defaultSpec = (if builtins.hasAttr "url" spec && builtins.hasAttr "sha256" spec + then spec // + { outPath = callFunctionWith spec (getFetcher spec) { }; } + else spec) // (if tryFromPath.success + then let path = tryFromPath.value; + in { + outPath = builtins.trace "using search host <${host}>" ( + if pkgs.lib.hasPrefix "/nix/store" (builtins.toString path) + then path else gitignoreSource path); + } + else {}); + in if builtins.hasAttr "rev" spec && builtins.hasAttr "url" spec then + defaultSpec // + { revOverride = rev: if (rev == null) then defaultSpec else + let + spec' = removeAttrs (spec // { + rev = rev; + url = builtins.replaceStrings [defaultSpec.rev] [rev] defaultSpec.url; + }) [ "sha256" ]; + in + spec' // + { outPath = callFunctionWith spec' (getFetcher spec') { }; }; + } + else defaultSpec + ) sources diff --git a/nix/windows-release.nix b/nix/windows-release.nix index 174d8b6f09e..f54237cd3a2 100644 --- a/nix/windows-release.nix +++ b/nix/windows-release.nix @@ -9,7 +9,7 @@ let testData = ../lib/jormungandr/test/data/jormungandr; name = "cardano-wallet-jormungandr-${project.version}-win64"; jm-bat = pkgs.writeText "jm.bat" '' - jormungandr.exe --config config.yaml --genesis-block block0.bin --secret secret.yaml + jormungandr.exe --config config.yaml --genesis-block-hash HASH ''; cw-bat = pkgs.writeText "cw.bat" '' cardano-wallet-jormungandr.exe serve --node-port 8081 --genesis-hash HASH --database c:\\cardano-wallet-jormungandr\\wallet.db @@ -22,7 +22,6 @@ in pkgs.runCommand name { cp -v ${cardano-wallet-jormungandr}/bin/* . cp -v ${jormungandr-win64}/bin/* . - cp -v ${testData}/block0.bin ${testData}/secret.yaml . cp -v ${jm-bat} jm.bat hash="$(jcli genesis hash --input block0.bin)" sed -e "s/HASH/$hash/" ${cw-bat} > cw.bat diff --git a/release.nix b/release.nix index 957de0963de..3c0124e7d56 100644 --- a/release.nix +++ b/release.nix @@ -6,7 +6,7 @@ }: with (import ./nix/release-lib.nix) { - inherit (import ./nix/iohk-common.nix {}) pkgs; + inherit (import ./nix/lib.nix {}) pkgs; inherit supportedSystems supportedCrossSystems scrubJobs projectArgs; packageSet = import cardano-wallet; gitrev = cardano-wallet.rev; From 2c848869d675a253c404ac77016d41e7003579bd Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Fri, 11 Oct 2019 20:32:52 -0400 Subject: [PATCH 03/15] add shell with niv --- default.nix | 16 ++++++++++++++++ lib.nix | 2 ++ nix/sources.json | 6 +++--- shell.nix | 7 ++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 583afbe7f09..0fb07b08277 100644 --- a/default.nix +++ b/default.nix @@ -58,4 +58,20 @@ in { pkgs.pkgconfig pkgs.sqlite-interactive iohkLib.hlint iohkLib.openapi-spec-validator ]; }; + devopsShell = pkgs.stdenv.mkDerivation { + name = "devops-shell"; + buildInputs = [ iohkLib.niv ]; + shellHook = '' + echo "DevOps Tools" \ + | ${pkgs.figlet}/bin/figlet -f banner -c \ + | ${pkgs.lolcat}/bin/lolcat + + echo "NOTE: you may need to export GITHUB_TOKEN if you hit rate limits with niv" + echo "Commands: + * niv update - update package + + " + ''; + + }; } diff --git a/lib.nix b/lib.nix index 4a0779931d2..af7564b4a58 100644 --- a/lib.nix +++ b/lib.nix @@ -3,7 +3,9 @@ let sources = import ./nix/sources.nix; iohkNix = import sources.iohk-nix (args // { nixpkgsOverride = import sources.nixpkgs args; }); + niv = (import sources.niv {}).niv; in iohkNix.pkgs.lib // iohkNix // { inherit sources; + inherit niv; } diff --git a/nix/sources.json b/nix/sources.json index e39c37224e0..e57bf91a67d 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -41,10 +41,10 @@ "homepage": "https://github.com/NixOS/nixpkgs", "owner": "NixOS", "repo": "nixpkgs-channels", - "rev": "88f32cca5a47b788556c00c7057d09ef083d3bfb", - "sha256": "0my931ilq66983bfr9k4s6j911a3mgwqmjbyd45w54xb68bcirba", + "rev": "dbad7c7d59f12e81032bc3100e3d9fa44b6d4e70", + "sha256": "1pjhslnhz4gngbclyr39x4xaicrc1sz2xy8bsrvlr3cl5qrbki2b", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs-channels/archive/88f32cca5a47b788556c00c7057d09ef083d3bfb.tar.gz", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/dbad7c7d59f12e81032bc3100e3d9fa44b6d4e70.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/shell.nix b/shell.nix index 82fb296083f..68f2c5cf59c 100644 --- a/shell.nix +++ b/shell.nix @@ -1 +1,6 @@ -(import ./default.nix {}).shell +let + self = import ./default.nix {}; + shell = self.shell; + devops = self.devopsShell; + +in (import ./default.nix {}).shell // { inherit devops; } From 0838ee9183c48cad1546b8404f70fcff2ed67000 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Fri, 11 Oct 2019 22:04:45 -0400 Subject: [PATCH 04/15] window release fixes and 0.5.6 bump --- default.nix | 2 ++ lib.nix | 4 ++-- nix/jormungandr.nix | 2 +- nix/sources.json | 12 ++++++++++++ nix/windows-release.nix | 13 +++++++------ release.nix | 8 ++++++-- 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/default.nix b/default.nix index 0fb07b08277..bddc7cac1b7 100644 --- a/default.nix +++ b/default.nix @@ -26,6 +26,8 @@ let inherit (iohkLib.nix-tools) iohk-extras iohk-module; }; + daedalusBridge = pkgs.callPackage ./nix/daedalus-bridge.nix { }; + in { inherit pkgs iohkLib src haskellPackages; inherit cardano-http-bridge cardano-sl-node jormungandr jormungandr-cli; diff --git a/lib.nix b/lib.nix index af7564b4a58..6939373e60e 100644 --- a/lib.nix +++ b/lib.nix @@ -4,8 +4,8 @@ let sources = import ./nix/sources.nix; iohkNix = import sources.iohk-nix (args // { nixpkgsOverride = import sources.nixpkgs args; }); niv = (import sources.niv {}).niv; + jormungandrLib = import (sources.jormungandr-nix + "/lib.nix"); in iohkNix.pkgs.lib // iohkNix // { - inherit sources; - inherit niv; + inherit sources niv jormungandrLib; } diff --git a/nix/jormungandr.nix b/nix/jormungandr.nix index b2883436dbe..ea902bbbf10 100644 --- a/nix/jormungandr.nix +++ b/nix/jormungandr.nix @@ -40,7 +40,7 @@ let windows = rec { # URL and hash of windows binary release url = "https://github.com/input-output-hk/jormungandr/releases/download/v${release.version}/jormungandr-v${release.version}-x86_64-pc-windows-msvc.zip"; - sha256 = "0dd2b2r50kcwakn61sv7xvf2s1yl586rlk8zch2bpfw9bjqrs0hl"; + sha256 = "1i0fgkmd16y26xf5dmsvd983lclm93zi5025f1xyqrd3xp4mjm7h"; }; jormungandr-win64 = pkgs.runCommand "jormungandr-win64-${release.version}" { diff --git a/nix/sources.json b/nix/sources.json index e57bf91a67d..56729c0b319 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -23,6 +23,18 @@ "url": "https://github.com/input-output-hk/iohk-nix/archive/e12c8b0d56e9a776a0a4e06614ee3f631e209084.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "jormungandr-nix": { + "branch": "master", + "description": "jormungandr nix scripts", + "homepage": null, + "owner": "input-output-hk", + "repo": "jormungandr-nix", + "rev": "00c9639a5031e593c5d257c0e0d8f5c746120f0b", + "sha256": "127nzgmlxr2w7a0xyd7rk9i855ds1r29k1i2pa49dz22rffdrjg9", + "type": "tarball", + "url": "https://github.com/input-output-hk/jormungandr-nix/archive/00c9639a5031e593c5d257c0e0d8f5c746120f0b.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "niv": { "branch": "iohk", "description": "Easy dependency management for Nix projects", diff --git a/nix/windows-release.nix b/nix/windows-release.nix index f54237cd3a2..176c77dfba3 100644 --- a/nix/windows-release.nix +++ b/nix/windows-release.nix @@ -3,16 +3,18 @@ , project , jpkgs ? import ./jormungandr.nix { inherit pkgs; } , jormungandr-win64 ? jpkgs.jormungandr-win64 +, jormungandrLib }: let testData = ../lib/jormungandr/test/data/jormungandr; + jormungandrConfig = builtins.toFile "config.yaml" (builtins.toJSON jormungandrLib.defaultJormungandrConfig); name = "cardano-wallet-jormungandr-${project.version}-win64"; jm-bat = pkgs.writeText "jm.bat" '' - jormungandr.exe --config config.yaml --genesis-block-hash HASH + jormungandr.exe --config config.yaml --genesis-block-hash ${jormungandrLib.genesisHash} ''; cw-bat = pkgs.writeText "cw.bat" '' - cardano-wallet-jormungandr.exe serve --node-port 8081 --genesis-hash HASH --database c:\\cardano-wallet-jormungandr\\wallet.db + cardano-wallet-jormungandr.exe serve --node-port 8081 --genesis-hash ${jormungandrLib.genesisHash} ''; in pkgs.runCommand name { nativeBuildInputs = [ pkgs.zip pkgs.jq pkgs.gnused project.jormungandr-cli ]; @@ -23,10 +25,9 @@ in pkgs.runCommand name { cp -v ${cardano-wallet-jormungandr}/bin/* . cp -v ${jormungandr-win64}/bin/* . cp -v ${jm-bat} jm.bat - hash="$(jcli genesis hash --input block0.bin)" - sed -e "s/HASH/$hash/" ${cw-bat} > cw.bat - sed -e 's/storage:.*/storage: "c:\\\\cardano-wallet-jormungandr\\\\storage"/' \ - ${testData}/config.yaml > config.yaml + cp -v ${pkgs.libffi}/bin/libffi-6.dll . + cp -v ${pkgs.openssl.out}/lib/libeay32.dll . + cp ${jormungandrConfig} config.yaml chmod -R +w . zip -r $out/${name}.zip . diff --git a/release.nix b/release.nix index 3c0124e7d56..a2313ab555d 100644 --- a/release.nix +++ b/release.nix @@ -5,8 +5,11 @@ , projectArgs ? { config = { allowUnfree = false; inHydra = true; }; } }: -with (import ./nix/release-lib.nix) { - inherit (import ./nix/lib.nix {}) pkgs; +let + iohkLib = import ./lib.nix {}; + +in with (import ./nix/release-lib.nix) { + inherit (iohkLib) pkgs; inherit supportedSystems supportedCrossSystems scrubJobs projectArgs; packageSet = import cardano-wallet; gitrev = cardano-wallet.rev; @@ -41,6 +44,7 @@ let cardano-wallet-jormungandr-win64 = import ./nix/windows-release.nix { inherit pkgs project; cardano-wallet-jormungandr = jobs.x86_64-pc-mingw32.cardano-wallet-jormungandr.x86_64-linux; + jormungandrLib = iohkLib.jormungandrLib; }; } # Build the shell derivation in Hydra so that all its dependencies From f76bf9710f9d33941b870353ffd0729a29aecdec Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Thu, 10 Oct 2019 00:36:16 -0300 Subject: [PATCH 05/15] add an example daedalus-bridge --- daedalus-bridge.nix | 32 ++++++++++++++++++++++++++++++++ default.nix | 30 ++++++++++++++++++++++-------- nix/jormungandr.nix | 2 +- 3 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 daedalus-bridge.nix diff --git a/daedalus-bridge.nix b/daedalus-bridge.nix new file mode 100644 index 00000000000..43de5f27485 --- /dev/null +++ b/daedalus-bridge.nix @@ -0,0 +1,32 @@ +{ target, pkgs, haskellPackages, system, crossSystem, jormungandr }: + +let + commonLib = import ./nix/iohk-common.nix {}; + pkgsCross = commonLib.getPkgs { crossSystem = pkgs.lib.systems.examples.mingwW64; }; + cardano-shell-src = pkgs.fetchFromGitHub { + owner = "input-output-hk"; + repo = "cardano-shell"; + rev = "efba204c14a83b9e1af9bb138c2d551fe3d7a43e"; + sha256 = "0cr260b1drj4yal91fxcai9007jgbi2i2mh3mjnkq2rzjz6rvh8s"; + }; + cardano-shell = import cardano-shell-src { inherit system crossSystem; }; # todo, shell should accept target +in pkgs.runCommandCC "daedalus-bridge" {} '' + mkdir -pv $out/bin $out/config + touch $out/config/todo + cd $out/bin + cp ${haskellPackages.cardano-wallet-jormungandr.components.exes.cardano-wallet-jormungandr}/bin/cardano-wallet-jormungandr* . + cp ${cardano-shell.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher* . + #cp {nix-tools.cexes.cardano-node.cardano-node}/bin/cardano-node* . + ${pkgs.lib.optionalString (target == "x86_64-windows") '' + echo ${jormungandr} + cp ${pkgsCross.libffi}/bin/libffi-6.dll . + cp ${pkgsCross.openssl.out}/lib/libeay32.dll . + ''} + ${pkgs.lib.optionalString (target == "x86_64-linux") '' + chmod +w -R . + for bin in cardano-launcher; do + strip $bin + patchelf --shrink-rpath $bin + done + ''} +'' diff --git a/default.nix b/default.nix index bddc7cac1b7..2dbe8977bbd 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,26 @@ -{ system ? builtins.currentSystem -, crossSystem ? null -, config ? {} -# Import IOHK common nix lib -, iohkLib ? import ./lib.nix { inherit system crossSystem config; } -# Use nixpkgs pin from iohkLib -, pkgs ? iohkLib.pkgs +{ config ? {} +, target ? builtins.currentSystem +, backend ? "jormungandr" # TODO, make this work: cardano or jormungandr }: -with import ./nix/util.nix { inherit pkgs; }; +let + commonLib = import ./lib.nix {}; + lib = commonLib.pkgs.lib; + systemTable = { + x86_64-windows = builtins.currentSystem; + }; + crossSystemTable = { + x86_64-windows = lib.systems.examples.mingwW64; + }; + system = systemTable.${target} or target; + crossSystem = crossSystemTable.${target} or null; + # Import IOHK common nix lib + iohkLib = import ./lib.nix { inherit system crossSystem config; }; + # Use nixpkgs pin from iohkLib + pkgs = iohkLib.pkgs; +in +with import ./nix/util.nix { inherit pkgs; }; let haskell = iohkLib.nix-tools.haskell { inherit pkgs; }; src = iohkLib.cleanSourceHaskell ./.; @@ -41,6 +53,8 @@ in { tests = collectComponents "tests" isCardanoWallet haskellPackages; benchmarks = collectComponents "benchmarks" isCardanoWallet haskellPackages; + daedalus-bridge = import ./daedalus-bridge.nix { inherit target pkgs haskellPackages system crossSystem jormungandr; }; + shell = haskellPackages.shellFor { name = "cardano-wallet-shell"; packages = ps: with ps; [ diff --git a/nix/jormungandr.nix b/nix/jormungandr.nix index ea902bbbf10..afcde87cbda 100644 --- a/nix/jormungandr.nix +++ b/nix/jormungandr.nix @@ -34,7 +34,7 @@ let # Hash of git repo and all of its submodules. sha256 = "1w0xcx1h09wv25qdyybamxxl8sqd2npja12n3vpvz0sgv88c3mix"; # Hash of all Cargo dependencies. - cargoSha256 = "0pflam5am760z4pz3j1ga4arsixmay2487sgpqrhrkiaws4nxy57"; + cargoSha256 = "sha256:0pflam5am760z4pz3j1ga4arsixmay2487sgpqrhrkiaws4nxy57"; }; windows = rec { From f7fe1333c1c3c71fcf00dc5f1dcb4bc025f4c945 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Tue, 15 Oct 2019 15:09:44 -0400 Subject: [PATCH 06/15] clean-up tasks --- default.nix | 4 +--- daedalus-bridge.nix => nix/daedalus-bridge.nix | 13 ++++--------- nix/sources.json | 12 ++++++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) rename daedalus-bridge.nix => nix/daedalus-bridge.nix (68%) diff --git a/default.nix b/default.nix index 2dbe8977bbd..1a754698d22 100644 --- a/default.nix +++ b/default.nix @@ -38,8 +38,6 @@ let inherit (iohkLib.nix-tools) iohk-extras iohk-module; }; - daedalusBridge = pkgs.callPackage ./nix/daedalus-bridge.nix { }; - in { inherit pkgs iohkLib src haskellPackages; inherit cardano-http-bridge cardano-sl-node jormungandr jormungandr-cli; @@ -53,7 +51,7 @@ in { tests = collectComponents "tests" isCardanoWallet haskellPackages; benchmarks = collectComponents "benchmarks" isCardanoWallet haskellPackages; - daedalus-bridge = import ./daedalus-bridge.nix { inherit target pkgs haskellPackages system crossSystem jormungandr; }; + daedalus-bridge = import ./nix/daedalus-bridge.nix { inherit target pkgs haskellPackages system crossSystem jormungandr; }; shell = haskellPackages.shellFor { name = "cardano-wallet-shell"; diff --git a/daedalus-bridge.nix b/nix/daedalus-bridge.nix similarity index 68% rename from daedalus-bridge.nix rename to nix/daedalus-bridge.nix index 43de5f27485..88da2ad7c41 100644 --- a/daedalus-bridge.nix +++ b/nix/daedalus-bridge.nix @@ -1,18 +1,13 @@ { target, pkgs, haskellPackages, system, crossSystem, jormungandr }: let - commonLib = import ./nix/iohk-common.nix {}; + commonLib = import ../lib.nix {}; pkgsCross = commonLib.getPkgs { crossSystem = pkgs.lib.systems.examples.mingwW64; }; - cardano-shell-src = pkgs.fetchFromGitHub { - owner = "input-output-hk"; - repo = "cardano-shell"; - rev = "efba204c14a83b9e1af9bb138c2d551fe3d7a43e"; - sha256 = "0cr260b1drj4yal91fxcai9007jgbi2i2mh3mjnkq2rzjz6rvh8s"; - }; - cardano-shell = import cardano-shell-src { inherit system crossSystem; }; # todo, shell should accept target + cardano-shell = import commonLib.sources.cardano-shell { inherit system crossSystem; }; # todo, shell should accept target + jormungandrConfig = builtins.toFile "config.yaml" (builtins.toJSON commonLib.jormungandrLib.defaultJormungandrConfig); in pkgs.runCommandCC "daedalus-bridge" {} '' mkdir -pv $out/bin $out/config - touch $out/config/todo + cp ${jormungandrConfig} $out/config/jormungandr-config.yaml cd $out/bin cp ${haskellPackages.cardano-wallet-jormungandr.components.exes.cardano-wallet-jormungandr}/bin/cardano-wallet-jormungandr* . cp ${cardano-shell.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher* . diff --git a/nix/sources.json b/nix/sources.json index 56729c0b319..e79186c87a2 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,4 +1,16 @@ { + "cardano-shell": { + "branch": "master", + "description": "Node shell, a thin layer for running the node and it's modules.", + "homepage": null, + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "a06b256c3cd836f823f85c729d1aae0c8c13011c", + "sha256": "0gh1mqq5gkqaf81nmp96n9rnw9x6jnqpr4hxa99m4pnbcyc03f93", + "type": "tarball", + "url": "https://github.com/input-output-hk/cardano-shell/archive/a06b256c3cd836f823f85c729d1aae0c8c13011c.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "gitignore": { "branch": "master", "description": "Nix function for filtering local git sources", From 3f4d255de4d72f73c43dceeb448a4d820aa75490 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Tue, 15 Oct 2019 16:55:44 -0400 Subject: [PATCH 07/15] bump iohk-nix --- nix/.stack.nix/default.nix | 14 -------------- nix/iohk-nix-src.json | 7 ------- nix/jormungandr.nix | 2 +- nix/sources.json | 6 +++--- 4 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 nix/iohk-nix-src.json diff --git a/nix/.stack.nix/default.nix b/nix/.stack.nix/default.nix index 13024328622..45cf8f36a7a 100644 --- a/nix/.stack.nix/default.nix +++ b/nix/.stack.nix/default.nix @@ -44,20 +44,6 @@ }; }) { packages = {}; } - { - packages = { - "iohk-monitoring" = { - flags = { - "disable-examples" = true; - "disable-ekg" = true; - "disable-systemd" = true; - "disable-prometheus" = true; - "disable-gui" = true; - "disable-graylog" = true; - }; - }; - }; - } ]; compiler = "ghc-8.6.5"; } \ No newline at end of file diff --git a/nix/iohk-nix-src.json b/nix/iohk-nix-src.json deleted file mode 100644 index cc586db85ca..00000000000 --- a/nix/iohk-nix-src.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "url": "https://github.com/input-output-hk/iohk-nix", - "rev": "61eeda0bd3e64cad648c5a5c3f0e0c806dd9234b", - "date": "2019-10-14T18:29:30+00:00", - "sha256": "06ki4bjwahvfiixyyml0g1d7zr2w6fqj4jqksp1q3lb3rwlfb5fz", - "fetchSubmodules": false -} diff --git a/nix/jormungandr.nix b/nix/jormungandr.nix index afcde87cbda..e19e811f690 100644 --- a/nix/jormungandr.nix +++ b/nix/jormungandr.nix @@ -40,7 +40,7 @@ let windows = rec { # URL and hash of windows binary release url = "https://github.com/input-output-hk/jormungandr/releases/download/v${release.version}/jormungandr-v${release.version}-x86_64-pc-windows-msvc.zip"; - sha256 = "1i0fgkmd16y26xf5dmsvd983lclm93zi5025f1xyqrd3xp4mjm7h"; + sha256 = "sha256:16pxgi4igvfh2kccsbyizfc4wyxr8fs1872hpsmr99ppna09rqi3"; }; jormungandr-win64 = pkgs.runCommand "jormungandr-win64-${release.version}" { diff --git a/nix/sources.json b/nix/sources.json index e79186c87a2..36e0d045990 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -29,10 +29,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "e12c8b0d56e9a776a0a4e06614ee3f631e209084", - "sha256": "1byl96cms33da5hil53sbw5bzss6zzga5vvf2lin2df8i2kg6bhh", + "rev": "2edd52c16a0e688d6611c03c47a89ca1f80fee91", + "sha256": "0lrg2rx1agh1nnv3mwanhk964x94vx22z1g7kaia8c4bc1fy3ajj", "type": "tarball", - "url": "https://github.com/input-output-hk/iohk-nix/archive/e12c8b0d56e9a776a0a4e06614ee3f631e209084.tar.gz", + "url": "https://github.com/input-output-hk/iohk-nix/archive/2edd52c16a0e688d6611c03c47a89ca1f80fee91.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "jormungandr-nix": { From 23d8260fc4d6b3e4f2bebcf5e6f77e8ff772daf1 Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Tue, 15 Oct 2019 23:25:57 -0300 Subject: [PATCH 08/15] update to the launcher without tls generation --- nix/sources.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 36e0d045990..f8513f10d6c 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,14 +1,14 @@ { "cardano-shell": { - "branch": "master", + "branch": "disable-tls", "description": "Node shell, a thin layer for running the node and it's modules.", "homepage": null, "owner": "input-output-hk", "repo": "cardano-shell", - "rev": "a06b256c3cd836f823f85c729d1aae0c8c13011c", - "sha256": "0gh1mqq5gkqaf81nmp96n9rnw9x6jnqpr4hxa99m4pnbcyc03f93", + "rev": "db5ec0511e09685590b71d14002080e89dc6c7a9", + "sha256": "0p1bw48lzchfz0qa1d4n4lxjd457kchs0ylyr8111nz6ivsjpkzc", "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-shell/archive/a06b256c3cd836f823f85c729d1aae0c8c13011c.tar.gz", + "url": "https://github.com/input-output-hk/cardano-shell/archive/db5ec0511e09685590b71d14002080e89dc6c7a9.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "gitignore": { From 6880b0c2dd4cc9042d9332dc345aa1ce2b31de6e Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Wed, 16 Oct 2019 14:07:51 -0300 Subject: [PATCH 09/15] include jcli in the daedalus-bridge --- default.nix | 2 +- nix/daedalus-bridge.nix | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 1a754698d22..3317913f98a 100644 --- a/default.nix +++ b/default.nix @@ -51,7 +51,7 @@ in { tests = collectComponents "tests" isCardanoWallet haskellPackages; benchmarks = collectComponents "benchmarks" isCardanoWallet haskellPackages; - daedalus-bridge = import ./nix/daedalus-bridge.nix { inherit target pkgs haskellPackages system crossSystem jormungandr; }; + daedalus-bridge = import ./nix/daedalus-bridge.nix { inherit target pkgs haskellPackages system crossSystem jormungandr jormungandr-cli; }; shell = haskellPackages.shellFor { name = "cardano-wallet-shell"; diff --git a/nix/daedalus-bridge.nix b/nix/daedalus-bridge.nix index 88da2ad7c41..7b41a7c622e 100644 --- a/nix/daedalus-bridge.nix +++ b/nix/daedalus-bridge.nix @@ -1,4 +1,4 @@ -{ target, pkgs, haskellPackages, system, crossSystem, jormungandr }: +{ target, pkgs, haskellPackages, system, crossSystem, jormungandr, jormungandr-cli }: let commonLib = import ../lib.nix {}; @@ -11,6 +11,7 @@ in pkgs.runCommandCC "daedalus-bridge" {} '' cd $out/bin cp ${haskellPackages.cardano-wallet-jormungandr.components.exes.cardano-wallet-jormungandr}/bin/cardano-wallet-jormungandr* . cp ${cardano-shell.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher* . + cp ${jormungandr-cli}/bin/jcli* . #cp {nix-tools.cexes.cardano-node.cardano-node}/bin/cardano-node* . ${pkgs.lib.optionalString (target == "x86_64-windows") '' echo ${jormungandr} From 9517d8182bf443a4168733c951b4b74159c39f37 Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Wed, 16 Oct 2019 15:24:23 -0300 Subject: [PATCH 10/15] dont use the generated config file --- lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs b/lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs index 364c989a7be..129c0f45873 100644 --- a/lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs +++ b/lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs @@ -464,8 +464,8 @@ withJormungandr tr (JormungandrConfig stateDir block0 mPort logSeverity output e startBackend (apiPort, baseUrl) = getGenesisBlockArg block0 >>= \case Right (block0H, genesisBlockArg) -> do let args = genesisBlockArg ++ - [ "--config", nodeConfigFile - , "--log-level", C.toLower <$> show logSeverity + [ -- "--config", nodeConfigFile + "--log-level", C.toLower <$> show logSeverity ] ++ map T.unpack extraArgs let cmd = Command "jormungandr" args (return ()) output let tr' = transformLauncherTrace tr From b4e28e101ba660b376e80234aabca73e7984b417 Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Wed, 16 Oct 2019 15:55:51 -0300 Subject: [PATCH 11/15] update launcher to not set DAEDALUS_CONFIG --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index f8513f10d6c..395c591aa44 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "cardano-shell", - "rev": "db5ec0511e09685590b71d14002080e89dc6c7a9", - "sha256": "0p1bw48lzchfz0qa1d4n4lxjd457kchs0ylyr8111nz6ivsjpkzc", + "rev": "7a818677756110a6068c7affc4bb043ea81e390e", + "sha256": "1z6wwsivcw03jks4xypqcpwcz487b0g565w6wrbhdln36r6q4lfb", "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-shell/archive/db5ec0511e09685590b71d14002080e89dc6c7a9.tar.gz", + "url": "https://github.com/input-output-hk/cardano-shell/archive/7a818677756110a6068c7affc4bb043ea81e390e.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "gitignore": { From be0adf33c8938e10a6099bb71f66ebbd33a1354e Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Wed, 16 Oct 2019 16:10:23 -0300 Subject: [PATCH 12/15] update jormungandr-nix --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 395c591aa44..7a90f24a925 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -41,10 +41,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "jormungandr-nix", - "rev": "00c9639a5031e593c5d257c0e0d8f5c746120f0b", - "sha256": "127nzgmlxr2w7a0xyd7rk9i855ds1r29k1i2pa49dz22rffdrjg9", + "rev": "219543bce9b518e5d6ccd95f9b33e33bf98ff507", + "sha256": "0l85aahvfj77kzzr0kk2il9nawxk6i26a0kx0dz1namkkqhrnrmz", "type": "tarball", - "url": "https://github.com/input-output-hk/jormungandr-nix/archive/00c9639a5031e593c5d257c0e0d8f5c746120f0b.tar.gz", + "url": "https://github.com/input-output-hk/jormungandr-nix/archive/219543bce9b518e5d6ccd95f9b33e33bf98ff507.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { From bf6037e6d1c5b348a6399d914238020c6141cd5c Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Wed, 16 Oct 2019 16:51:21 -0300 Subject: [PATCH 13/15] wait an hour for the node to start --- lib/core/src/Cardano/Wallet/Network.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/Cardano/Wallet/Network.hs b/lib/core/src/Cardano/Wallet/Network.hs index c17325c67b2..8bd75a95759 100644 --- a/lib/core/src/Cardano/Wallet/Network.hs +++ b/lib/core/src/Cardano/Wallet/Network.hs @@ -176,7 +176,7 @@ waitForNetwork nw policy = do -- for no longer than a minute. defaultRetryPolicy :: Monad m => RetryPolicyM m defaultRetryPolicy = - limitRetriesByCumulativeDelay (60 * second) (exponentialBackoff 10000) + limitRetriesByCumulativeDelay (3600 * second) (exponentialBackoff 10000) where second = 1000*1000 From 547e6554457e96e1a011e9837f59e712e0ff175c Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Thu, 17 Oct 2019 17:58:37 -0300 Subject: [PATCH 14/15] expose node and wallet versions as attributes of the bridge --- nix/daedalus-bridge.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nix/daedalus-bridge.nix b/nix/daedalus-bridge.nix index 7b41a7c622e..2c10d18f4ee 100644 --- a/nix/daedalus-bridge.nix +++ b/nix/daedalus-bridge.nix @@ -5,7 +5,12 @@ let pkgsCross = commonLib.getPkgs { crossSystem = pkgs.lib.systems.examples.mingwW64; }; cardano-shell = import commonLib.sources.cardano-shell { inherit system crossSystem; }; # todo, shell should accept target jormungandrConfig = builtins.toFile "config.yaml" (builtins.toJSON commonLib.jormungandrLib.defaultJormungandrConfig); -in pkgs.runCommandCC "daedalus-bridge" {} '' +in pkgs.runCommandCC "daedalus-bridge" { + passthru = { + node-version = jormungandr.version; + wallet-version = haskellPackages.cardano-wallet-jormungandr.identifier.version; + }; +} '' mkdir -pv $out/bin $out/config cp ${jormungandrConfig} $out/config/jormungandr-config.yaml cd $out/bin From 4860168f7107ed8fede21079a6d6e75bf9f6e157 Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Thu, 17 Oct 2019 21:19:53 -0300 Subject: [PATCH 15/15] update shell --- nix/sources.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 7a90f24a925..148b89d6dcd 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "cardano-shell", - "rev": "7a818677756110a6068c7affc4bb043ea81e390e", - "sha256": "1z6wwsivcw03jks4xypqcpwcz487b0g565w6wrbhdln36r6q4lfb", + "rev": "b8b07142f713119b07e40ebcb5173fb2bd304c1e", + "sha256": "1j4nnsiagvv1yqfr4h9ailnnd7iw62vim1w7bc0sb5blngfjgvjr", "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-shell/archive/7a818677756110a6068c7affc4bb043ea81e390e.tar.gz", + "url": "https://github.com/input-output-hk/cardano-shell/archive/b8b07142f713119b07e40ebcb5173fb2bd304c1e.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "gitignore": {