utils: add support for bitcoin-wallet tool configuration file #30421

issue rishkwal openend this issue on July 10, 2024
  1. rishkwal commented at 1:30 pm on July 10, 2024: none

    Please describe the feature you’d like to see added.

    I would like to propose the addition of support for a configuration file specifically for the bitcoin-wallet tool. This feature would allow users to specify command-line options in a configuration file (e.g., wallet.conf), similar to how bitcoin.conf works for bitcoind. The configuration file should be automatically loaded by bitcoin-wallet if present in the default data directory or specified via a command-line option.

    Yes, this feature is related to the problem of having to repeatedly specify command-line options every time the bitcoin-wallet tool is used. For users who frequently interact with the bitcoin-wallet tool, it can be cumbersome and error-prone to enter the same options repeatedly, such as -datadir, -wallet, and debugging options.

    Describe the solution you’d like

    • Configuration File Support: Implement support for a wallet.conf file that can contain the various options and arguments currently passed via the command line.
    • Automatic Loading: If a wallet.conf file is found in the default data directory, it should be automatically loaded by the bitcoin-wallet tool.
    • Command-line Override: Allow users to specify an alternative configuration file location using a -conf=<file> command-line option.
    • Option Precedence: Command-line options should take precedence over those specified in the configuration file, allowing for flexible and dynamic usage.

    Describe any alternatives you’ve considered

    No response

    Please leave any additional context

    No response

  2. rishkwal added the label Feature on Jul 10, 2024
  3. ryanofsky commented at 2:11 pm on July 10, 2024: contributor

    I tend to think it would be better if the wallet-tool just loaded the bitcoin.conf file and used applicable settings from it instead of having its own config file. I actually implemented this in ae5fc323b2441bc45c38737f1ffb40d777b134d8 from #27409 (for an unrelated reason, mentioned in the commit message).

    The advantage of having one config file instead of two is it might avoid the need to specify the same settings twice, and avoid the possibility of inconsistent settings being specified. But I’m not sure if there might be other reasons for wanting a separate wallet config file. Would be curious about use-cases.

  4. rishkwal commented at 3:23 pm on July 10, 2024: none

    I see bitcoin-wallet as a distinct entity from bitcoind, bitcoin-cli, and bitcoin-qt, which are tightly coupled. bitcoin-cli already manages wallets alongside the node, but bitcoin-wallet offers independent wallet management. Having a separate wallet.conf allows for independent wallet management without altering node settings. It provides the flexibility to manage additional wallets without affecting the main wallet configured via bitcoin-cli and simplifies configuration for users who only need wallet-specific settings, which is beneficial in lightweight or automated environments.

    For example, a developer can use bitcoin-cli to manage their main wallet with bitcoin.conf, while simultaneously using bitcoin-wallet with a separate wallet.conf to create and test multiple wallets without impacting the main wallet’s settings. Using bitcoin.conf can indeed prevent redundancy, but a separate wallet.conf provides essential flexibility and separation for diverse use cases.

  5. asolo525 commented at 5:43 am on August 18, 2024: none
    IMG-20240817-WA0031

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me