Open kmajs opened 1 month ago
it appears
jmclient/configure.py
is not setting them properly
How can I reproduce this?
I thought the jmclient/configure.py
script was called somewhere in the nix-bitcoin
module, but looking back through, I couldn't find where that happens.
There may be an easier way to do this, but I used this flake to make a container so I could check the contents of a fresh joinmarket.cfg
.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nix-bitcoin.url = "github:fort-nix/nix-bitcoin/release";
};
outputs =
{ nixpkgs, nix-bitcoin, ... }:
{
nixosConfigurations.btc = nixpkgs.lib.nixosSystem {
modules = [
(
{ ... }:
{
imports = [ nix-bitcoin.nixosModules.default ];
nixpkgs.hostPlatform = "x86_64-linux";
boot.isContainer = true;
nix-bitcoin.generateSecrets = true;
services.joinmarket.enable = true;
}
)
];
};
};
}
Then:
sudo nixos-container create --flake .#btc btc
sudo nixos-container run btc
sudo nixos-container root-login btc
# cat /var/lib/joinmarket/joinmarket.cfg
Joinmarket loads the default config from jmclient/configure.py
and then merges the user-provided config (/var/lib/joinmarket/joinmarket.cfg
) into it.
Why do you think the default settings from jmclient/configure.py
are not present in the final config at runtime?
Oh, I see - yes, that makes a lot more sense. :)
I changed a joinmarket [POLICY]
setting:
joinmarket = {
enable = true;
settings.POLICY.merge_algorithm = "gradual";
yieldgenerator = { enable = true; };
};
and my yield-generator stopped filling offers and the joinmarketd
logs showed lots of these:
Received commitment broadcast by other maker: 4ef0...ae, now blacklisted.
I pasted in the defaults that had been removed and the yieldgenerator started filling orders again.
Note: I get the same behavior even if settings
is not defined.
I still can't reproduce this. In my tests the config merging works correctly.
Can you share the nix-bitcoin config where joinmarket-yieldgenerator
works correctly for you and the config where it fails?
I'll then check how both joinmarket configs differ at runtime.
This section is from an older version of this post. It's only relevant if you want to try debugging this by yourself.
Here's a version of nix-bitcoin that patches joinmarket to print its config at startup. (Unfortunately, because of https://github.com/NixOS/nixpkgs/issues/44426, we can't simply add a config setting that overrides joinmarket, but we have to change nix-bitcoin instead.)
Do the following:
joinmarket-yieldgenerator
with the config that's working for you.joinmarket-yieldgenerator
instance:
journalctl --since "$(systemctl show -p InactiveExitTimestamp --timestamp=us --value joinmarket-yieldgenerator)" -u joinmarket-yieldgenerator
Copy the printed config values from the beginning of the log. It should look like this:
{'DAEMON': [('no_daemon', '0'),
('daemon_port', '27183'),
...
'BLOCKCHAIN': [('blockchain_source', 'bitcoin-rpc'),
('network', 'mainnet'),
...
The defaults were removed here, but it appears
jmclient/configure.py
is not setting them properly. The[POLICY]
section is missing and it doesn't look like the joinmarket code has fallback values if these are missing.