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

issue kek-coin openend this issue on July 5, 2017
  1. kek-coin commented at 9:17 am on July 5, 2017: none

    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.

  2. laanwj added the label Docs and Output on Jul 5, 2017
  3. laanwj commented at 1:45 pm on July 5, 2017: member

    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.

  4. kek-coin commented at 4:05 pm on July 5, 2017: none
    @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?
  5. h0jeZvgoxFepBQ2C commented at 6:30 pm on August 31, 2017: none
    +1 this would really help a lot of people.
  6. justinmoon commented at 7:16 pm on May 13, 2018: contributor

    First time user here trying to run a full node.

    Once I finally got everything working and $ bitcoind -printtoconsole started spitting out progress, I found myself wondering “What configuration am I using?”. The output included the string “Using config file /home/vagrant/.bitcoin/bitcoin.conf”. But no such file existed, which was odd.

    No idea how to improve, but in my experience this was one of the more confusing parts of running daemon for the first time.

  7. MarcoFalke added the label good first issue on May 13, 2018
  8. leishman referenced this in commit 6486d2b742 on Jul 26, 2018
  9. leishman referenced this in commit 4a17fffe70 on Jul 26, 2018
  10. leishman referenced this in commit 703c10b998 on Jul 26, 2018
  11. leishman referenced this in commit 6928d1f582 on Jul 26, 2018
  12. leishman referenced this in commit 2939d38fe6 on Jul 26, 2018
  13. leishman referenced this in commit 04be012da9 on Jul 26, 2018
  14. leishman referenced this in commit a517c47665 on Jul 26, 2018
  15. leishman referenced this in commit 08def4b624 on Jul 26, 2018
  16. cisba commented at 4:45 pm on September 7, 2018: contributor
    As pointed by @laanwj “…the data directory is not known at the time of the installation process. It’s chosen on first run”. But isn’t this feature the origin of problems? Isn’t that a choice to be moved in the packages setup process? If the answer would be yes, then the setup could put also the bitcoin.conf file in the right place.
  17. MarcoFalke commented at 5:09 pm on September 7, 2018: member
    Related: #14057
  18. leishman commented at 9:32 pm on September 9, 2018: contributor
    @MarcoFalke yes, #14057 is the simplest solution to this problem. Creating the default conf file is a bit more complex and will probably have to be merged later.
  19. jarolrod commented at 4:53 am on March 10, 2021: member

    Why not just instruct someone to cp the example bitcoin.conf under bitcoin/share/examples/ into their data directory. This can be included in the docs somewhere in the appropriate place. Something like the following:

    If you would like to configure your bitcoin node, an example bitcoin.conf including all possible configuration options is provided. Copy this example into your data directory.

    0cp share/examples/bitcoin.conf ~/my/data/dir/bitcoin.conf
    

    You can now open up the copied file with your favorite text editor and uncomment the options that fit your needs.

  20. laanwj commented at 7:23 am on March 15, 2021: member
    I like your suggestion @jarolrod . Having a documented example configuration could be useful. But it would not be good to have another separate source of truth for the option help (more maintenance work, creates a merge “hotspot”, documentations can diverge over time). Could it be generated from the --help on make install?
  21. josibake commented at 10:59 am on June 11, 2021: member

    @laanwj seems like it would be possible to generate from --help using something like the following:

    0bitcoind -h | sed -E "s/^[[:space:]]{2}\-/#/" | sed -E "s/^[[:space:]]{7}/# /" | sed '/[=[:space:]]/!s/#.*$/&=1/' > /path/to/example/bitcoin.conf
    

    not 100% there (remove a few options like version, conf and add some text that explains it is a config file), but does this seem like a feasible approach? if so, i can finish the sed expression.

    also, im not super familiar with make and wasn’t sure where to add this expression so that it gets run during make install. any pointers?

  22. josibake referenced this in commit b624755f49 on Jun 17, 2021
  23. josibake referenced this in commit 60fb568ec0 on Jun 18, 2021
  24. josibake referenced this in commit 9df03cb5c5 on Aug 9, 2021
  25. josibake referenced this in commit e128fc9add on Aug 10, 2021
  26. chrisbward commented at 9:57 pm on October 7, 2021: none

    This isn’t great. It’s just caught me out.

    What’s the most basic conf to get going?

    I’m doing everything over cli, so I’m totally in the dark here

  27. chrisbward commented at 10:20 pm on October 7, 2021: none
    What’s the most basic conf file I could need? At least someone post that please…. I’m on 22
  28. josibake referenced this in commit e7b89a3037 on Oct 19, 2021
  29. josibake referenced this in commit 6bb5004123 on Dec 22, 2021
  30. josibake referenced this in commit f8902efcb1 on Dec 22, 2021
  31. josibake referenced this in commit b6951c09d0 on Dec 27, 2021
  32. ghost commented at 3:17 am on December 28, 2021: none

    @chrisbward Try this https://jlopp.github.io/bitcoin-core-config-generator/ and use the drop down on right-top to generate some predefined conf

    Or check different options and create a config file based on your needs

  33. josibake referenced this in commit e7b3d75022 on Dec 28, 2021
  34. niVelion commented at 1:22 pm on January 12, 2022: none
    Since @MarcoFalke added the “good first issue” label to this issue @josibake and @prayank23 have proposed PRs, I think this label could at least for now be removed - I’m not sure this is the best starting point anymore.
  35. MarcoFalke commented at 1:27 pm on January 12, 2022: member
    “Good first issue” also means that this might be a good starting point to review. Instead of looking for “good first issue” to create a pull request, one can also look for “good first issue” to find existing pull requests to review.
  36. josibake referenced this in commit 24fa77492d on Jan 12, 2022
  37. josibake referenced this in commit dbaa3e5498 on Jan 12, 2022
  38. josibake referenced this in commit 53826de216 on Jan 12, 2022
  39. gargabhishek100 commented at 8:51 am on January 25, 2022: none
    Is this issue is still open? Is anything there to help into?
  40. ghost commented at 9:26 am on January 25, 2022: none

    Is this issue is still open? Is anything there to help into?

    Yes you can help by reviewing @gargabhishek100 : https://github.com/bitcoin/bitcoin/pull/23931

  41. josibake referenced this in commit 6f4af10640 on Mar 17, 2022
  42. josibake referenced this in commit 288be2613f on Mar 17, 2022
  43. josibake referenced this in commit b239b35211 on Apr 25, 2022
  44. josibake referenced this in commit 1c7e820ded on May 2, 2022
  45. laanwj closed this on May 4, 2022

  46. laanwj referenced this in commit d4475ea7ae on May 4, 2022
  47. DrahtBot locked this on May 4, 2023

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-11-17 09:12 UTC

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