From 06b2ec5b0293328b9a3cf7f818be19ded229d347 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 16 Oct 2020 17:43:16 +0200 Subject: [PATCH] joinmarket: add regtest support --- modules/joinmarket.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/joinmarket.nix b/modules/joinmarket.nix index 0785289..6738478 100644 --- a/modules/joinmarket.nix +++ b/modules/joinmarket.nix @@ -19,7 +19,7 @@ let [BLOCKCHAIN] blockchain_source = bitcoin-rpc - network = mainnet + network = ${bitcoind.network} rpc_host = ${builtins.elemAt bitcoind.rpcbind 0} rpc_port = ${toString bitcoind.rpc.port} rpc_user = ${bitcoind.rpc.users.privileged.name} @@ -156,7 +156,8 @@ in { "s|@@RPC_PASSWORD@@|rpc_password = $(cat ${secretsDir}/bitcoin-rpcpassword-privileged)|" \ '${cfg.dataDir}/joinmarket.cfg' ''; - ExecStartPost = nix-bitcoin-services.privileged '' + # Generating wallets (jmclient/wallet.py) is only supported for mainnet or testnet + ExecStartPost = mkIf (bitcoind.network == "mainnet") (nix-bitcoin-services.privileged '' walletname=wallet.jmdat pw=$(cat "${secretsDir}"/jm-wallet-password) mnemonic=${secretsDir}/jm-wallet-seed @@ -171,7 +172,7 @@ in { recoveryseed=$(echo "$out" | grep 'recovery_seed') echo "$recoveryseed" | cut -d ':' -f2 > $mnemonic fi - ''; + ''); ExecStart = "${pkgs.nix-bitcoin.joinmarket}/bin/joinmarketd"; WorkingDirectory = "${cfg.dataDir}"; # The service creates 'commitmentlist' in the working dir User = "${cfg.user}";