Skip to content

Commit

Permalink
Add ogmios 6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrus committed Mar 28, 2024
1 parent db723d3 commit 9259b1c
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 2 deletions.
22 changes: 21 additions & 1 deletion native-arm/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 66 additions & 1 deletion native-arm/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

ogmios-5-6-0 = { url = "https://github.com/CardanoSolutions/ogmios.git"; ref = "refs/tags/v5.6.0"; type = "git"; submodules = true; flake = false; };
ogmios-6-1-0 = { url = "https://github.com/CardanoSolutions/ogmios.git"; ref = "refs/tags/v6.1.0"; type = "git"; submodules = true; flake = false; };
ogmios-6-2-0 = { url = "https://github.com/CardanoSolutions/ogmios.git"; ref = "refs/tags/v6.2.0"; type = "git"; submodules = true; flake = false; };
};

outputs = inputs: {
Expand Down Expand Up @@ -217,6 +218,70 @@

++

(let
input = "ogmios-6-2-0";
version = builtins.replaceStrings ["refs/tags/v"] [""] (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.${input}.original.ref;
patched = pkgs.runCommandNoCC "ogmios-src" {} ''
cp -r ${inputs.${input}} $out
chmod -R +w $out
find $out -name cabal.project.freeze -delete -o -name package.yaml -delete
grep -RF -- -external-libsodium-vrf $out | cut -d: -f1 | sort --uniq | xargs -n1 -- sed -r s/-external-libsodium-vrf//g -i
( cd $out && patch -p1 -i ${./ogmios-6-1-0--missing-srp-hash.patch} ; )
'';
nodeFlake = inputs.self.outputs.packages.${system}."cardano-node-8-9-1--flake";
inherit (nodeFlake.legacyPackages.${system}) haskell-nix;
project = haskell-nix.project {
compiler-nix-name = "ghc963";
projectFileName = "cabal.project";
inputMap = { "https://input-output-hk.github.io/cardano-haskell-packages" = nodeFlake.inputs.CHaP; };
src = patched + "/server";
modules = [ ({ lib, pkgs, ... }: {
packages.cardano-crypto-praos.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf ] ];
packages.cardano-crypto-class.components.library.pkgconfig = lib.mkForce [ ([ pkgs.libsodium-vrf pkgs.secp256k1 ]
++ (if pkgs ? libblst then [pkgs.libblst] else [])) ];
packages.ogmios.components.library.preConfigure = "export GIT_SHA=${inputs.${input}.rev}";
}) ];
};
ogmios = project.hsPkgs.ogmios.components.exes.ogmios;
in [
{ name = "${input}"; value = ogmios; }
{
name = "${input}--oci";
value = let
pkgs = nodeFlake.legacyPackages.${system};
in retagOCI "ogmios" "v${version}" (pkgs.dockerTools.buildImage {
name = "ogmios";
tag = "v${version}";
config = {
ExposedPorts = {
"1337/tcp" = {};
};
Labels = {
description = "A JSON WebSocket bridge for cardano-node.";
name = "ogmios";
};
Entrypoint = [ "/bin/ogmios" ];
StopSignal = "SIGINT";
Healthcheck = {
Test = [ "CMD-SHELL" "/bin/ogmios health-check" ];
Interval = 10000000000;
Timeout = 5000000000;
Retries = 1;
};
};
copyToRoot = pkgs.buildEnv {
name = "ogmios-env";
paths = [ ogmios ] ++ (with pkgs; [ busybox ]);
postBuild = ''
cp -r ${patched}/server/config/network $out/config
'';
};
});
}
])

++

(let
input = "cardano-db-sync-13-1-0-0";
version = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.${input}.original.ref;
Expand Down Expand Up @@ -415,7 +480,7 @@
};
}).defaultNix;
in [
# { name = "${input}--flake"; value = theFlake; }
{ name = "${input}--flake"; value = theFlake; }
# { name = "${input}--cardano-node"; value = theFlake.packages.${system}.cardano-node; }
# { name = "${input}--cardano-submit-api"; value = theFlake.packages.${system}.cardano-submit-api; }
{ name = "${input}--oci"; value = retagOCI "cardano-node" version theFlake.legacyPackages.${system}.dockerImage; }
Expand Down

0 comments on commit 9259b1c

Please sign in to comment.