diff --git a/pkgs/default.nix b/pkgs/default.nix index 1402c42b..af1663a0 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -73,7 +73,7 @@ bls = callPackage2311 ./bls {}; mcl = callPackage2311 ./mcl {}; }; - ssvnode = callPackage2311 ./ssvnode { + ssvnode = callPackage ./ssvnode { bls = callPackage2311 ./bls {}; mcl = callPackage2311 ./mcl {}; }; diff --git a/pkgs/ssvnode/default.nix b/pkgs/ssvnode/default.nix index 0b7fc6e7..d509607b 100644 --- a/pkgs/ssvnode/default.nix +++ b/pkgs/ssvnode/default.nix @@ -1,29 +1,43 @@ { bls, - mcl, - buildGo120Module, + buildGoModule, fetchFromGitHub, + mcl, + openssl, }: -buildGo120Module rec { +buildGoModule rec { pname = "ssv"; - version = "1.3.8"; + version = "2.0.0"; src = fetchFromGitHub { - owner = "bloxapp"; + owner = "ssvlabs"; repo = "${pname}"; - rev = "v${version}"; - hash = "sha256-5JUaJwo8snUrw/Uhk23uiGr+YV4UogiyvLGXXPiYICY="; + rev = "e39f1d0ec67c47f6ba437d83367aba0d2b4d34dd"; + hash = "sha256-2/o+FyfJcX/Av82O3DV3gSkLHDtJCoUw2+zpozyr628="; }; - vendorHash = "sha256-paFwSCVQEEkZzd/QHGBfaPvDwSAXYxvS5Cq+N18QTIU="; + vendorHash = "sha256-lr62X/Fo97CzxKgwdNCv3OELa6yMSEQBOs2cG53rYJY="; buildInputs = [bls mcl]; + ldflags = [ + "-X main.Commit=${src.rev}" + "-X main.Version=v${version}" + ]; + + # Dynamic loading of openssl + # See: https://github.com/ssvlabs/ssv/blob/v2.0.0-unstable.0/operator/keys/rsa_linux.go#L30 + postFixup = '' + patchelf \ + --add-rpath ${openssl.out}/lib \ + $out/bin/ssvnode + ''; + subPackages = ["cmd/ssvnode"]; meta = { description = "Secret-Shared-Validator(SSV) for ethereum staking"; - homepage = "https://github.com/bloxapp/ssv"; + homepage = "https://github.com/ssvlabs/ssv"; platforms = ["x86_64-linux"]; mainProgram = "ssvnode"; };