pool: add pkg, module & tests

This commit is contained in:
kon 2021-03-01 10:59:23 +01:00
parent f214a703a5
commit eb21012745
12 changed files with 215 additions and 1 deletions

View file

@ -10,6 +10,7 @@ let self = {
nixops19_09 = pkgs.callPackage ./nixops { };
netns-exec = pkgs.callPackage ./netns-exec { };
lightning-loop = pkgs.callPackage ./lightning-loop { };
lightning-pool = pkgs.callPackage ./lightning-pool { };
extra-container = pkgs.callPackage ./extra-container { };
clightning-plugins = import ./clightning-plugins pkgs self.nbPython3Packages;
clboss = pkgs.callPackage ./clboss { };

View file

@ -0,0 +1,25 @@
{ pkgs, buildGoModule, fetchurl, lib }:
buildGoModule rec {
pname = "lightning-pool";
version = "0.4.4-alpha";
src = fetchurl {
url = "https://github.com/lightninglabs/pool/archive/v${version}.tar.gz";
# Use ./get-sha256.sh to fetch latest (verified) sha256
sha256 = "c50f3b10a4fa7ce1afd6a00fd6c44474f44c8c773de34261e62ae805540ab140";
};
subPackages = [ "cmd/pool" "cmd/poold" ];
vendorSha256 = "190qy3cz18ipv8ilpqhbaaxfi9j2isxpwhagzzspa3pwcpssrv52";
meta = with lib; {
description = ''
A non-custodial batched uniform clearing-price auction for Lightning Channel Leases (LCL)
'';
homepage = "https://github.com/lightninglabs/pool";
license = lib.licenses.mit;
maintainers = with maintainers; [ sputn1ck ];
};
}

View file

@ -0,0 +1,27 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p git gnupg
set -euo pipefail
TMPDIR="$(mktemp -d -p /tmp)"
trap "rm -rf $TMPDIR" EXIT
cd $TMPDIR
echo "Fetching latest release"
git clone https://github.com/lightninglabs/pool 2> /dev/null
cd pool
latest=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest release is ${latest}"
# GPG verification
export GNUPGHOME=$TMPDIR
echo "Fetching Olaoluwa Osuntokun's key"
gpg --keyserver hkps://keys.openpgp.org --recv-keys 60A1FA7DA5BFF08BDCBBE7903BBD59E99B280306 2> /dev/null
echo "Fetching Oliver Gugger's key"
gpg --keyserver hkps://keys.openpgp.org --recv-keys F4FC70F07310028424EFC20A8E4256593F177720 2> /dev/null
echo "Verifying latest release"
git verify-tag ${latest}
echo "tag: ${latest}"
# The prefix option is necessary because GitHub prefixes the archive contents in this format
echo "sha256: $(git archive --format tar.gz --prefix=pool-${latest//v}/ ${latest} | sha256sum | cut -d\ -f1)"