Skip to content

Conversation

@promag
Copy link
Contributor

@promag promag commented Feb 27, 2019

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

Examples:

bitcoind -printconfig
 datadir:   /Users/joao/Library/Application Support/Bitcoin
 blocksdir: /Users/joao/Library/Application Support/Bitcoin/blocks

# network is handled
bitcoind -printconfig -regtest
 datadir:   /Users/joao/Library/Application Support/Bitcoin
 blocksdir: /Users/joao/Library/Application Support/Bitcoin/regtest/blocks

# support overriding datadir
bitcoind -datadir=/tmp -testnet -printconfig
 datadir:   /tmp
 blocksdir: /tmp/testnet3/blocks

@promag
Copy link
Contributor Author

promag commented Feb 27, 2019

Suggested in #15438 (comment).

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

@darosior
Copy link
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 ?

@promag
Copy link
Contributor Author

promag commented Feb 27, 2019

Why print the block dir since you already print datadir ?

Because depends on the network.

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 27, 2019

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.

@Sjors
Copy link
Member

Sjors commented Feb 27, 2019

Concept ACK, but to prevent endless bike shedding, it should just print everything except passwords.

@promag
Copy link
Contributor Author

promag commented Feb 27, 2019

You mean iterate ArgsManager?

@Sjors
Copy link
Member

Sjors commented Feb 27, 2019

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.

@instagibbs
Copy link
Member

concept ACK, it might be completely redundant, but printing explicitly which file is being used as conf would be useful.

@laanwj
Copy link
Member

laanwj commented Mar 7, 2019

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).

@hebasto
Copy link
Member

hebasto commented Mar 9, 2019

Concept ACK.

@promag
Copy link
Contributor Author

promag commented Mar 17, 2019

In order to print everything I have to move the default from GetArg(..., default_value) to AddArg(...). Is this acceptable?

@practicalswift
Copy link
Contributor

Concept ACK

@luke-jr
Copy link
Member

luke-jr commented Apr 17, 2019

@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?

@DrahtBot
Copy link
Contributor

Needs rebase

@kristapsk
Copy link
Contributor

Concept ACK

@DrahtBot
Copy link
Contributor

There hasn't been much activity lately and the patch still needs rebase, so I am closing this for now. Please let me know when you want to continue working on this, so the pull request can be re-opened.

@DrahtBot DrahtBot closed this Aug 16, 2019
@promag
Copy link
Contributor Author

promag commented Aug 19, 2019

I'll pick this again once flags are settled.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.