rfc: Add -printconfig arg to bitcoind #15493

pull promag wants to merge 5 commits into bitcoin:master from promag:2019-02-printconfig changing 5 files +81 −12
  1. promag commented at 10:17 am on February 27, 2019: member

    This PR adds the -printconfig argument to bitcoind. Like -help and -version, after printing to the console it exits.

    Examples:

     0bitcoind -printconfig
     1 datadir:   /Users/joao/Library/Application Support/Bitcoin
     2 blocksdir: /Users/joao/Library/Application Support/Bitcoin/blocks
     3
     4# network is handled
     5bitcoind -printconfig -regtest
     6 datadir:   /Users/joao/Library/Application Support/Bitcoin
     7 blocksdir: /Users/joao/Library/Application Support/Bitcoin/regtest/blocks
     8
     9# support overriding datadir
    10bitcoind -datadir=/tmp -testnet -printconfig
    11 datadir:   /tmp
    12 blocksdir: /tmp/testnet3/blocks
    
  2. Add -printconfig arg to bitcoind 1cf795de7e
  3. promag commented at 10:18 am on February 27, 2019: member

    Suggested in #15438 (comment).

    If you concept ACK feel free to suggest other configs to print.

  4. fanquake added the label Brainstorming on Feb 27, 2019
  5. darosior commented at 10:46 am on February 27, 2019: member

    I think we could print :

    • the path to the pid file
    • whether or not txindex is activated
    • if we listen through tor
    • what we debug (which category, ips, timestamps)

    Why print the block dir since you already print datadir ?

  6. promag commented at 11:07 am on February 27, 2019: member

    Why print the block dir since you already print datadir ?

    Because depends on the network.

  7. DrahtBot commented at 11:49 am on February 27, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15849 (Thread names in logs and deadlock debug tools by jamesob)
    • #15457 (Check std::system for -[alert|block|wallet]notify by Sjors)
    • #15329 (Fix InitError() and InitWarning() content by hebasto)
    • #12557 ([WIP] 64 bit iOS device support by Sjors)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. Sjors commented at 1:35 pm on February 27, 2019: member
    Concept ACK, but to prevent endless bike shedding, it should just print everything except passwords.
  9. promag commented at 1:41 pm on February 27, 2019: member
    You mean iterate ArgsManager?
  10. Sjors commented at 1:49 pm on February 27, 2019: member
    Yes, that might be useful to see which options override others. So ideally do this after the parameter interaction stuff. In that case it won’t complete if there’s a problem, but those problems generally have their own error message which should contain enough information.
  11. instagibbs commented at 3:55 pm on March 7, 2019: member
    concept ACK, it might be completely redundant, but printing explicitly which file is being used as conf would be useful.
  12. laanwj commented at 3:55 pm on March 7, 2019: member

    Yes, that might be useful to see which options override others. So ideally do this after the parameter interaction stuff. In that case it won’t complete if there’s a problem, but those problems generally have their own error message which should contain enough information.

    I tend to agree. If you’re going to do this, print everything that can be printed, I guess apart from really sensitive options (purely to prevent shoulder surfing, as any user being able to run this will have by definition access to bitcoin.conf, unlike the case for an equivalent RPC command).

  13. hebasto commented at 3:45 pm on March 9, 2019: member
    Concept ACK.
  14. wip: basic support and -listen and -disablewallet c77fb0934c
  15. Refactor -rest default value f16e7ddba8
  16. Refactor -stopafterblockimport default value e2f43af4e2
  17. Refactor -logtimestamps default value 48eed15372
  18. promag commented at 11:35 pm on March 17, 2019: member
    In order to print everything I have to move the default from GetArg(..., default_value) to AddArg(...). Is this acceptable?
  19. practicalswift commented at 7:33 pm on March 22, 2019: contributor
    Concept ACK
  20. luke-jr commented at 8:23 am on April 17, 2019: member

    @promag IMO we should probably do that anyway.

    Perhaps also print it in a format that could be put directly in a bitcoin.conf if so desired?

  21. DrahtBot added the label Needs rebase on Apr 30, 2019
  22. DrahtBot commented at 7:37 pm on April 30, 2019: member
  23. kristapsk commented at 9:17 pm on May 14, 2019: contributor
    Concept ACK
  24. DrahtBot added the label Up for grabs on Aug 16, 2019
  25. DrahtBot commented at 2:02 pm on August 16, 2019: member
  26. DrahtBot closed this on Aug 16, 2019

  27. promag commented at 0:08 am on August 19, 2019: member
    I’ll pick this again once flags are settled.
  28. laanwj removed the label Needs rebase on Oct 24, 2019
  29. MarcoFalke locked this on Dec 16, 2021

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-19 00:12 UTC

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