Bitcoin Core question:

Am I missing something here, or?

There is no longer a static example bitcoin.conf, so you have to generate it dynamically using a script (contrib/devtools/gen-bitcoin-conf.sh), but that script is not part of the binary distribution? (right?)

And there isn't documentation listing the meaning of all the configuration options to put into the file (which is what you get by running the above script, I believe)? (maybe I'm wrong? my searching is drawing a blank). As an example of that, see this:

https://github.com/MrChrisJ/fullnode/blob/master/Setup_Guides/bitcoin.conf

.. but that's very old, and obv it's better to be able to create your own.

It used to be the case a long time ago that running bitcoind would autogenerate a bitcoin.conf, but that's no longer true either.

How does someone running bitcoind from the binary distribution, figure out how to set config options?

Reply to this note

Please Login to reply.

Discussion

You can figure out a lot from running:

bitcoind --help

But I'm not sure that answers your questions, because I guess you already knew the --help flag.

That’s a fucking good question. Personally I refer to loops config generator tool, but there really should be a pre baked config file with # notes

#[2]​ has a conf generator website? My experience with hard coded conf files is users run with settings they don't understand.

That's not an argument against having the comments explaining the meaning of each variable.

It's debatable whether it's an argument against doing what e.g. Tor does and have all the useful variables *there*, with defaults, and commented out where appropriate.

The main thing is the documentation. I would be fine with just having it in external documentation.

In particular it doesn't make sense to put the generation function in an area only realistically accessible to developers, when non-dev users need this (in a sense that's the whole point of config files - to translate functionality manipulation into a form that non-developers can use).

All the people recommending lopp's generator, you're right, and I found that, but it's really not the same thing as what I think *should* exist:

A sample conf **with extensive comments on each variable setting**. This existed before, and I believe it still does, but weirdly it seems to be only available if you compile the repo and then run a script, which of course, very few people will do. (+ all the "am I right?" caveats above).

It would be at least something to be able to find those comments/explanations on some doc website or in the repo somewhere else.

Someone mentioned `--help` for bitcoind, that is a fair point, it does cover a lot of the same settings (maybe, arguably, all of them? not sure).

the output of gen-bitcoin-conf is shipped with the binaries. so every binary release now comes with a fully commented out bitcoin.conf file that is guaranteed to be correct for that release e.g up to date options, accurate help text. if you found an example where it wasn’t, let me know!

gen-bitcoin-conf takes the output and documentation directly from bitcoind —help, which is the source of truth.

i agree the comments could be better, but it should be documented in bitcoind —help. otherwise, we end up with multiple sources of truth, and a massive maintenance burden.

in fact, the old “documented” example was out of date and in some cases completely incorrect, which is why i wrote the gen-bitcoin-conf script

also, nothing against lopp’s work but encouraging users to get their config from some 3rd party on the internet is a nightmare. you can reeeeaally fuck up someone’s node with the config settings , and most users using sites like lopps probably aren’t able to vet whether or not the explanations and generated configs are malicious or not.

i’ve been planning to slowly add more detailed examples to the help output of bitcoind, would love to collab if you have ideas/suggestions

TLDR; there is a full, up to date, commented config file shipped with each release, and this file is the output of gen-bitcoin-conf.

users can also dynamically generate the file themselves if they are running bleeding edge master or a non-release compiled version of core

Josie,

thanks for the detailed answer!

So it seems my question was just out of date.

Because I can see now that in the *latest* binary distribution, indeed a full commented bitcoin.conf is right there at the top level of the directory tree.

It wasn't there in v0.21 but it is there in v24+ so it must have changed in between.

So what we have now is exactly how I expected it to be.

I agree that auto-generation from a website isn't great.

yep! the PR was merged in may 2022 iirc, so it should be available as early as v23.1.

you can also use the script to generate an accurate config for any previous release. so let’s say you want a full commented out config for 0.21 - all you’d need to do is download 0.21 (or compile it) and then set the BITCOIND env variable before running the script