Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JoinMarket update and improvements #702

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions pkgs/joinmarket/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{ stdenv, lib, fetchFromGitHub, python3, nbPython3PackagesJoinmarket }:

let
version = "0.9.10";
version = "0.9.11";
src = fetchFromGitHub {
owner = "joinmarket-org";
repo = "joinmarket-clientserver";
rev = "v${version}";
hash = "sha256-uNweI7VKC16CFn8MNOAvadcSnTjK/Fznfy4qctM5PR8=";
hash = "sha256-sYHhhp9BZz8udJuVAfwdt474OQPiye2ae5DOn5v5yEQ=";
};

runtimePackages = with nbPython3PackagesJoinmarket; [
joinmarketbase
joinmarketclient
joinmarketbitcoin
joinmarketdaemon
joinmarket
matplotlib # for ob-watcher
];

Expand All @@ -35,7 +32,6 @@ stdenv.mkDerivation {

cp scripts/joinmarketd.py "$out/bin/joinmarketd"
cpBin add-utxo.py
cpBin convert_old_wallet.py
cpBin receive-payjoin.py
cpBin sendpayment.py
cpBin sendtomany.py
Expand All @@ -62,7 +58,7 @@ stdenv.mkDerivation {
description = "Bitcoin CoinJoin implementation";
homepage = "https://github.com/JoinMarket-Org/joinmarket-clientserver";
license = licenses.gpl3Only;
maintainers = with maintainers; [ nixbitcoin ];
maintainers = with maintainers; [ seberm nixbitcoin ];
platforms = platforms.unix;
};
}
2 changes: 1 addition & 1 deletion pkgs/python-packages/bencoderpyx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildPythonPackageWithDepsCheck rec {
meta = with lib; {
description = "A fast bencode implementation in Cython";
homepage = "https://github.com/whtsky/bencoder.pyx";
maintainers = with maintainers; [ nixbitcoin ];
maintainers = with maintainers; [ seberm nixbitcoin ];
license = licenses.bsd3;
};
}
2 changes: 1 addition & 1 deletion pkgs/python-packages/chromalog/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildPythonPackageWithDepsCheck rec {
meta = with lib; {
description = "Enhance Python with colored logging";
homepage = "https://github.com/freelan-developers/chromalog";
maintainers = with maintainers; [ nixbitcoin ];
maintainers = with maintainers; [ seberm nixbitcoin ];
license = licenses.mit;
};
}
6 changes: 1 addition & 5 deletions pkgs/python-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ rec {
pyPkgsOverrides = self: super: let
inherit (self) callPackage;
clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; };
joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; };
in
{
txzmq = callPackage ./txzmq {};
Expand All @@ -20,10 +19,7 @@ rec {
runes = callPackage ./runes {};
sha256 = callPackage ./sha256 {};

joinmarketbase = joinmarketPkg ./jmbase;
joinmarketclient = joinmarketPkg ./jmclient;
joinmarketbitcoin = joinmarketPkg ./jmbitcoin;
joinmarketdaemon = joinmarketPkg ./jmdaemon;
joinmarket = callPackage ./joinmarket { inherit (nbPkgs.joinmarket) version src; };

## Specific versions of packages that already exist in nixpkgs

Expand Down
28 changes: 0 additions & 28 deletions pkgs/python-packages/jmbase/default.nix

This file was deleted.

27 changes: 0 additions & 27 deletions pkgs/python-packages/jmbitcoin/default.nix

This file was deleted.

67 changes: 0 additions & 67 deletions pkgs/python-packages/jmclient/default.nix

This file was deleted.

33 changes: 0 additions & 33 deletions pkgs/python-packages/jmdaemon/default.nix

This file was deleted.

103 changes: 103 additions & 0 deletions pkgs/python-packages/joinmarket/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{ version
, src
, lib
, buildPythonPackageWithDepsCheck
, pythonOlder
, pythonAtLeast
, pytestCheckHook
, setuptools
, fetchurl
, chromalog
, cryptography
, service-identity
, twisted
, txtorcon
, python-bitcointx
, argon2_cffi
, autobahn
, bencoderpyx
, klein
, mnemonic
, pyjwt
, werkzeug
, libnacl
, pyopenssl
}:

buildPythonPackageWithDepsCheck rec {
pname = "joinmarket";
inherit version src;
format = "pyproject";

# Since v0.9.11, Python older than v3.8 is not supported. Python v3.12 is
# still not supported.
disabled = (pythonOlder "3.8") || (pythonAtLeast "3.12");

nativeBuildInputs = [
setuptools
];

propagatedBuildInputs = [
# base jm packages
chromalog
cryptography
service-identity
twisted
txtorcon

# jmbitcoin
python-bitcointx

# jmclient
argon2_cffi
autobahn
bencoderpyx
klein
mnemonic
pyjwt
werkzeug

# jmdaemon
libnacl
pyopenssl
];

postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'txtorcon==23.11.0' 'txtorcon==23.5.0' \
--replace-fail 'twisted==23.10.0' 'twisted==23.8.0' \
--replace-fail 'service-identity==21.1.0' 'service-identity==23.1.0' \
--replace-fail 'cryptography==41.0.6' 'cryptography==41.0.3'

# Modify pyproject.toml to include only specific modules. Do not include 'jmqtui'.
sed -i '/^\[tool.setuptools.packages.find\]/a include = ["jmbase", "jmbitcoin", "jmclient", "jmdaemon"]' pyproject.toml
'';

nativeCheckInputs = [
pytestCheckHook
];

pytestFlagsArray = [
"test/jmbase/"
"test/jmbitcoin/"
"test/jmdaemon/test_enc_wrapper.py"

# Other tests require preconfigured bitcoind and miniircd
# https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/master/docs/TESTING.md
# "test/jmclient/"
# "test/jmdaemon/"
];

pythonImportsCheck = [
"jmbase"
"jmbitcoin"
"jmclient"
"jmdaemon"
];

meta = with lib; {
homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver";
maintainers = with maintainers; [ seberm nixbitcoin ];
license = licenses.gpl3;
};
}
10 changes: 7 additions & 3 deletions pkgs/python-packages/python-bitcointx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

buildPythonPackageWithDepsCheck rec {
pname = "python-bitcointx";
version = "1.1.4";
version = "1.1.5";

src = fetchFromGitHub {
owner = "Simplexum";
repo = "python-bitcointx";
rev = "python-bitcointx-v${version}";
hash = "sha256-y8/cyLQr3GbpYqCg8LKTfyL0OX7eIo5AxjdFTWTqHmk=";
hash = "sha256-KXndYEsJ8JRTiGojrKXmAEeGDlHrNGs5MtYs9XYiqMo=";
};

patchPhase = ''
Expand All @@ -18,10 +18,14 @@ buildPythonPackageWithDepsCheck rec {
done
'';

pythonImportCheck = [
"bitcointx"
];

meta = with lib; {
description = "Interface to Bitcoin transaction data structures";
homepage = "https://github.com/Simplexum/python-bitcointx";
maintainers = with maintainers; [ nixbitcoin ];
maintainers = with maintainers; [ seberm nixbitcoin ];
license = licenses.gpl3;
};
}
Loading