From 636d508b50356f0c997762fcaef084a312073f4d Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 30 May 2022 15:28:06 +0000 Subject: [PATCH 1/4] spark-wallet: use nodejs 14 instead of 12 since latter is EOL --- pkgs/spark-wallet/composition.nix | 2 +- pkgs/spark-wallet/generate.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/spark-wallet/composition.nix b/pkgs/spark-wallet/composition.nix index 01c4b77..087380e 100644 --- a/pkgs/spark-wallet/composition.nix +++ b/pkgs/spark-wallet/composition.nix @@ -2,7 +2,7 @@ {pkgs ? import { inherit system; - }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}: + }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}: let nodeEnv = import "${toString pkgs.path}/pkgs/development/node-packages/node-env.nix" { diff --git a/pkgs/spark-wallet/generate.sh b/pkgs/spark-wallet/generate.sh index 6f2aa7e..756790b 100755 --- a/pkgs/spark-wallet/generate.sh +++ b/pkgs/spark-wallet/generate.sh @@ -28,8 +28,11 @@ tar xvf $TMPDIR/$file -C $src --strip-components 1 >/dev/null jq '.dependencies["qrcode-terminal"] = .optionalDependencies["qrcode-terminal"]' $src/package.json | sponge $src/package.json # Generate nix pkg +# TODO-EXTERNAL: remove --nodejs-14 option once +# https://github.com/svanderburg/node2nix/pull/296 has made its way into a +# node2nix release. node2nix \ - --nodejs-12 \ + --nodejs-14 \ --input $src/package.json \ --lock $src/npm-shrinkwrap.json \ --composition composition.nix \ From a3ff1351d93f27a3aa183486d531a0eabafc7aef Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 30 May 2022 15:27:41 +0000 Subject: [PATCH 2/4] update nixpkgs btcpayserver: 1.5.1 -> 1.5.3 hwi: 2.1.0 -> 2.1.1 lndconnect: 0.2.0 -> 0.2.1 nbxplorer: 2.3.20 -> 2.3.26 --- flake.lock | 18 +++++++++--------- pkgs/pinned.nix | 4 ++-- test/nixos-search/flake.lock | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index baf755f..3db4bb9 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1652557277, - "narHash": "sha256-jSes9DaIVMdmwBB78KkFUVrlDzawmD62vrUg0GS2500=", + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "12806d31a381e7cd169a6bac35590e7b36dc5fe5", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "type": "github" }, "original": { @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1652559422, - "narHash": "sha256-jPVTNImBTUIFdtur+d4IVot6eXmsvtOcBm0TzxmhWPk=", + "lastModified": 1653830209, + "narHash": "sha256-V+HnLKJzvk2HZcLUKt9z2puZ46vLo74chOakxbLfXek=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8b3398bc7587ebb79f93dfeea1b8c574d3c6dba1", + "rev": "cc257c49c495b2d0d7d40c5753a452d0abc8adf3", "type": "github" }, "original": { @@ -33,11 +33,11 @@ }, "nixpkgsUnstable": { "locked": { - "lastModified": 1652692103, - "narHash": "sha256-ygRLh8g0F/WkVCSfQcxMoVaaD45i6Ky+f+b4wCOazag=", + "lastModified": 1653738054, + "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "556ce9a40abde33738e6c9eac65f965a8be3b623", + "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", "type": "github" }, "original": { diff --git a/pkgs/pinned.nix b/pkgs/pinned.nix index 3bb2f03..2a4f963 100644 --- a/pkgs/pinned.nix +++ b/pkgs/pinned.nix @@ -3,8 +3,7 @@ pkgs: pkgsUnstable: { inherit (pkgs) charge-lnd - extra-container - lndconnect; + extra-container; inherit (pkgsUnstable) bitcoin @@ -17,6 +16,7 @@ pkgs: pkgsUnstable: lightning-loop lightning-pool lnd + lndconnect nbxplorer; inherit pkgs pkgsUnstable; diff --git a/test/nixos-search/flake.lock b/test/nixos-search/flake.lock index 30fe2b3..92eb376 100644 --- a/test/nixos-search/flake.lock +++ b/test/nixos-search/flake.lock @@ -18,11 +18,11 @@ "nixos-org-configurations": { "flake": false, "locked": { - "lastModified": 1651495498, - "narHash": "sha256-u/WU4G+DBJp7L8UO7UMLcor7QHfHp8P6pKwDPhBz504=", + "lastModified": 1653498760, + "narHash": "sha256-KCNAUCcWkTQy/ddrZzYZrtiT3Zg6rLb7QIylUDvKcco=", "owner": "NixOS", "repo": "nixos-org-configurations", - "rev": "2a65c35c03163f0ecbe0f86f4bd56aaf5c4f4dd0", + "rev": "34b9422847c5b67cbdbe26b89201b3354557f677", "type": "github" }, "original": { @@ -38,11 +38,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1652295804, - "narHash": "sha256-VzvA5YxzPsn4t2tFLgj+QavsdO2YpH/1d3xrZ/18VdQ=", + "lastModified": 1653738462, + "narHash": "sha256-2eOJBUcahP6C7KmsYCM9GyZhGNFGyyUNmn0LNhEVKY4=", "owner": "nixos", "repo": "nixos-search", - "rev": "3b41f2dcfd3448efea38f241c5229ac4948e51a7", + "rev": "1bf3ce7c9829d3daedc46a000062d09339936034", "type": "github" }, "original": { From 568d728e5c036dd1b011b1defe56da35e3775b95 Mon Sep 17 00:00:00 2001 From: nixbitcoin Date: Fri, 27 May 2022 08:37:54 +0000 Subject: [PATCH 3/4] joinmarket: put python-packages in alphabetical order --- pkgs/python-packages/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/python-packages/default.nix b/pkgs/python-packages/default.nix index 39fdcc0..1479ee1 100644 --- a/pkgs/python-packages/default.nix +++ b/pkgs/python-packages/default.nix @@ -8,13 +8,13 @@ let unstable = (import ../nixpkgs-pinned.nix).nixpkgs-unstable; in { bencoderpyx = callPackage ./bencoderpyx {}; + chromalog = callPackage ./chromalog {}; coincurve = callPackage ./coincurve {}; python-bitcointx = callPackage ./python-bitcointx { inherit (nbPkgs) secp256k1; }; - urldecode = callPackage ./urldecode {}; - chromalog = callPackage ./chromalog {}; - txzmq = callPackage ./txzmq {}; - sha256 = callPackage ./sha256 {}; runes = callPackage ./runes {}; + sha256 = callPackage ./sha256 {}; + txzmq = callPackage ./txzmq {}; + urldecode = callPackage ./urldecode {}; joinmarketbase = joinmarketPkg ./jmbase; joinmarketclient = joinmarketPkg ./jmclient; From cb295d1a166ecea96f5ff336c7d9cac9087f1953 Mon Sep 17 00:00:00 2001 From: nixbitcoin Date: Fri, 27 May 2022 09:06:14 +0000 Subject: [PATCH 4/4] joinmarket: 0.9.5 -> 0.9.6 --- modules/joinmarket-ob-watcher.nix | 2 +- modules/joinmarket.nix | 46 +++++++++++++++++++++++++------ modules/netns-isolation.nix | 1 + pkgs/joinmarket/default.nix | 12 ++++---- 4 files changed, 46 insertions(+), 15 deletions(-) diff --git a/modules/joinmarket-ob-watcher.nix b/modules/joinmarket-ob-watcher.nix index 27b0b2c..604e7ed 100644 --- a/modules/joinmarket-ob-watcher.nix +++ b/modules/joinmarket-ob-watcher.nix @@ -49,7 +49,7 @@ let rpc_port = ${toString bitcoind.rpc.port} rpc_user = ${bitcoind.rpc.users.joinmarket-ob-watcher.name} - ${joinmarket.ircServers} + ${joinmarket.messagingConfig} ''; in { inherit options; diff --git a/modules/joinmarket.nix b/modules/joinmarket.nix index d7c4a0c..f5d2324 100644 --- a/modules/joinmarket.nix +++ b/modules/joinmarket.nix @@ -20,6 +20,21 @@ let default = 64180; # A random private port description = "The port corresponding to option `payjoinAddress`."; }; + messagingAddress = mkOption { + type = types.str; + default = "127.0.0.1"; + description = '' + The address where messaging onion connections are forwarded to. + This address is never used directly, it only serves as the internal endpoint + for the messaging onion service. + The onion service is automatically setup by joinmarket. + ''; + }; + messagingPort = mkOption { + type = types.port; + default = 64181; # payjoinPort + 1 + description = "The port corresponding to option `messagingAddress`."; + }; dataDir = mkOption { type = types.path; default = "/var/lib/joinmarket"; @@ -47,9 +62,9 @@ let defaultText = "(See source)"; }; # Used by ./joinmarket-ob-watcher.nix - ircServers = mkOption { + messagingConfig = mkOption { readOnly = true; - default = ircServers; + default = messagingConfig; defaultText = "(See source)"; }; # This option is only used by netns-isolation. @@ -133,7 +148,18 @@ let socks5_port = ${toString torAddress.port} ''; - ircServers = '' + messagingConfig = '' + [MESSAGING:onion] + type = onion + ${socks5Settings} + tor_control_host = unix:/run/tor/control + # required option, but ignored for unix socket host + tor_control_port = 9051 + onion_serving_host = ${cfg.messagingAddress} + onion_serving_port = ${toString cfg.messagingPort} + hidden_service_dir = + directory_nodes = 3kxw6lf5vf6y26emzwgibzhrzhmhqiw6ekrek3nqfjjmhwznb2moonad.onion:5222,jmdirjmioywe2s5jad7ts6kgcqg66rj6wujj6q77n6wbdrgocqwexzid.onion:5222,bqlpq6ak24mwvuixixitift4yu42nxchlilrcqwk2ugn45tdclg42qid.onion:5222 + # irc.darkscience.net [MESSAGING:server1] host = darkirc6tqgpnwd3blln3yfv5ckl47eg7llfxkmtovrv7c7iwohhb6ad.onion @@ -142,17 +168,17 @@ let usessl = true ${socks5Settings} - # irc.hackint.org + # ilita [MESSAGING:server2] - host = ncwkrwxpq2ikcngxq3dy2xctuheniggtqeibvgofixpzvrwpa77tozqd.onion + host = ilitafrzzgxymv6umx2ux7kbz3imyeko6cnqkvy4nisjjj4qpqkrptid.onion channel = joinmarket-pit port = 6667 usessl = false ${socks5Settings} - # ilita + # irc.hackint.org [MESSAGING:server3] - host = ilitafrzzgxymv6umx2ux7kbz3imyeko6cnqkvy4nisjjj4qpqkrptid.onion + host = ncwkrwxpq2ikcngxq3dy2xctuheniggtqeibvgofixpzvrwpa77tozqd.onion channel = joinmarket-pit port = 6667 usessl = false @@ -176,7 +202,7 @@ let rpc_user = ${bitcoind.rpc.users.privileged.name} ${optionalString (cfg.rpcWalletFile != null) "rpc_wallet_file = ${cfg.rpcWalletFile}"} - ${ircServers} + ${messagingConfig} [LOGGING] console_log_level = INFO @@ -195,11 +221,13 @@ let max_sats_freeze_reuse = -1 interest_rate = 0.015 bondless_makers_allowance = 0.125 + bond_value_exponent = 1.3 taker_utxo_retries = 3 taker_utxo_age = 5 taker_utxo_amtpercent = 20 accept_commitment_broadcasts = 1 commit_file_location = cmtdata/commitments.json + commitment_list_location = cmtdata/commitmentlist [PAYJOIN] payjoin_version = 1 @@ -209,6 +237,8 @@ let onion_socks5_host = ${torAddress.addr} onion_socks5_port = ${toString torAddress.port} tor_control_host = unix:/run/tor/control + # Required option, but unused because `tor_control_host` is a Unix socket + tor_control_port = 9051 onion_serving_host = ${cfg.payjoinAddress} onion_serving_port = ${toString cfg.payjoinPort} hidden_service_ssl = false diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index 97b32d0..c2e28fe 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -336,6 +336,7 @@ in { services.joinmarket = { payjoinAddress = netns.joinmarket.address; + messagingAddress = netns.joinmarket.address; cliExec = mkCliExec "joinmarket"; }; systemd.services.joinmarket-yieldgenerator = mkIf config.services.joinmarket.yieldgenerator.enable { diff --git a/pkgs/joinmarket/default.nix b/pkgs/joinmarket/default.nix index 4ffc890..c826596 100644 --- a/pkgs/joinmarket/default.nix +++ b/pkgs/joinmarket/default.nix @@ -1,18 +1,18 @@ { stdenv, lib, fetchurl, applyPatches, fetchpatch, python3, nbPythonPackageOverrides, pkgs }: let - version = "0.9.5"; + version = "0.9.6"; src = applyPatches { src = fetchurl { url = "https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/v${version}.tar.gz"; - sha256 = "0q8hfq4y7az5ly97brq1khhhvhnq6irzw0ginmz20fwn7w3yc5sn"; + sha256 = "040qj3abqkk74zyi5yav1ijlh5cmd49wlymald2lzk35adnx804g"; }; patches = [ (fetchpatch { - # https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1206 - name = "ob-export-fix"; - url = "https://patch-diff.githubusercontent.com/raw/JoinMarket-Org/joinmarket-clientserver/pull/1206.patch"; - sha256 = "0532gixjyc8r11sfmlf32v5iwy0rhkpa8rbvm4b7h509hnyycvhx"; + # https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1264 + name = "use-twisted-22.4.0"; + url = "https://patch-diff.githubusercontent.com/raw/JoinMarket-Org/joinmarket-clientserver/pull/1264.patch"; + sha256 = "1nlyhc5myph9239d5zczsl4jan4qj4ggy0l1f39jv0ihjbjhcks5"; }) ]; };