fort-nix / nix-bitcoin

A collection of Nix packages and NixOS modules for easily installing full-featured Bitcoin nodes with an emphasis on security.
https://nixbitcoin.org
MIT License
489 stars 101 forks source link

Allow for modification of the "merge_algorithm" for JoinMarket policy #707

Closed mariaa144 closed 2 weeks ago

mariaa144 commented 2 months ago

Nix-Bitcoin should alllow for the "merge_algorithm" to be modified to something other than "default". The "gradual" setting is nice for cleaning up UTXOs.

See: https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/35e6f286fb9be0dc90c2c5c7648d380c103a3870/src/jmclient/configure.py#L256

I believe I can manually modify the configuration after boot and restart the service but on rebuild it will get overridden. Is that right?

erikarvstedt commented 2 months ago

Here's a workaround to set merge_algorithm = gradual:

systemd.services.joinmarket.preStart = lib.mkAfter ''
  sed -i 's|merge_algorithm = default|merge_algorithm = gradual|' '${config.services.joinmarket.dataDir}/joinmarket.cfg'
'';

I've been long wanting to convert the joinmarket module to use a free-form attrset type for the ini config. This will make all these parameters configurable through the module. I'll add a patch soon.