Create a default bitcoin.conf in the correct location. #10746

Open
kek-coin opened this Issue Jul 5, 2017 · 2 comments

Comments

Projects
None yet
2 participants

kek-coin commented Jul 5, 2017

A recurring problem when helping new users getting started with running Bitcoin Core is the config file location; a lot of uncertainty is caused by the config file and the folders it should go in not being created automatically by the installation process.

It does not even have to be the full sample as found in contrib, just having an empty config file (or one with a minimal comment directing people to the sample file) created by default would ease the assisting of users on OSes one is not familiar with, as it would be easier for them to verify that they are putting their OS-agnostic configuration in the correct OS-specific location without some unnecessary trial-and-error.

Owner

laanwj commented Jul 5, 2017

not being created automatically by the installation process.

That's because the data directory is not known at the time of the installation process. It's chosen on first run.

It does not even have to be the full sample as found in contrib, just having an empty config file (or one with a minimal comment directing people to the sample file) created by default

If you are using the GUI, there's a button in the debug window to open it, also the path of the data directory can be found there.

OS-agnostic configuration in the correct OS-specific location without some unnecessary trial-and-error.

Indeed, this part is OS/distro-specific.

There is no requirement that the configuration file is writable (by the user that the daemon runs at) at all. A common setup for system-wide daemons is to put the configuration file somewhere under /etc/ and specify it using -conf. For this reason we don't write to the configuration file from bitcoind itself, not even to create it initially.

kek-coin commented Jul 5, 2017 edited

@laanwj fair points, would an acceptable solution be to try to create the default config file (including the appropriate directories) if -conf is not set and the default config file does not exist and fail gracefully on error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment