Unverified Commit 401e3d57 authored by Pavol Rusnak's avatar Pavol Rusnak Committed by GitHub
Browse files

Merge pull request #195782 from seberm/add-rust-teos

Add teos package (The Eye of Satoshi) with clightning watchtower plugin
parents e872be96 2f4f8e64
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -12175,6 +12175,15 @@
    githubId = 1940568;
    name = "Sebastian Ball";
  };
  seberm = {
    email = "seberm@seberm.com";
    github = "seberm";
    githubId = 212597;
    name = "Otto Sabart";
    keys = [{
      fingerprint = "0AF6 4C3B 1F12 14B3 8C8C  5786 1FA2 DBE6 7438 7CC3";
    }];
  };
  sebtm = {
    email = "mail@sebastian-sellmeier.de";
    github = "SebTM";
+3905 −0

File added.

Preview size limit exceeded, changes collapsed.

+80 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, llvmPackages
, openssl
, perl
, protobuf
, rustfmt
, Security
, SystemConfiguration
}:

let
  version = "0.1.2";

  src = fetchFromGitHub {
    owner = "talaia-labs";
    repo = "rust-teos";
    rev = "v${version}";
    hash = "sha256-N+srREYsADMTqz3uDXpeCuXrZZ62FopXO7DClGfyk9U=";
  };

  common.meta = with lib; {
    homepage = "https://github.com/talaia-labs/rust-teos";
    license = licenses.mit;
    maintainers = with maintainers; [ seberm ];
    platforms = platforms.unix;
  };

  cargoPatches = [ ./add-cargo-lock.patch ];

  buildInputs = [
    openssl
  ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];

  nativeBuildInputs = [
    perl  # used by openssl-sys to configure
    protobuf
    rustfmt
    llvmPackages.clang
  ];


  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
in
{
  teos = rustPlatform.buildRustPackage {
    pname = "teos";
    cargoSha256 = "sha256-7VYYYSMJ2JP1KuA8sD0X3wInubH/jbA/sgzsTsomyEc=";
    buildAndTestSubdir = "teos";

    inherit version src cargoPatches buildInputs nativeBuildInputs LIBCLANG_PATH;

    meta = common.meta // {
      description = "A Lightning watchtower compliant with BOLT13, written in Rust";
    };

    cargoTestFlags = [
      "--workspace"
    ];
  };

  teos-watchtower-plugin = rustPlatform.buildRustPackage {
    pname = "teos-watchtower-plugin";
    cargoSha256 = "sha256-xL+DiEfgBYJQ1UJm7LAr1/f34pkU8FRl4Seic8MFAlM=";
    buildAndTestSubdir = "watchtower-plugin";

    inherit version src cargoPatches buildInputs nativeBuildInputs LIBCLANG_PATH;

    meta = common.meta // {
      description = "A Lightning watchtower plugin for clightning";
    };

    # The test is skipped due to following error:
    #   thread 'retrier::tests::test_manage_retry_unreachable' panicked at 'assertion failed:
    #   wt_client.lock().unwrap().towers.get(&tower_id).unwrap().status.is_unreachable()', watchtower-plugin/src/retrier.rs:518:9
    checkFlags = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "--skip=retrier::tests::test_manage_retry_unreachable" ];
  };
}
+6 −0
Original line number Diff line number Diff line
@@ -33302,6 +33302,12 @@ with pkgs;
  taro = callPackage ../applications/blockchains/taro { };
  inherit (callPackages ../applications/blockchains/teos {
    inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration;
  })
    teos
    teos-watchtower-plugin;
  terra-station = callPackage ../applications/blockchains/terra-station { };
  tessera = callPackage ../applications/blockchains/tessera { };