Idea: Bitcoin.conf created by default #3902

issue i-rme openend this issue on March 19, 2014
  1. i-rme commented at 4:52 pm on March 19, 2014: contributor

    If you want to change the default settings of Bitcoin Core you have to:

    1. Go to %appdata%/Bitcoin
    2. Copy “Sample Bitcoin.conf” from https://en.bitcoin.it/wiki/Running_Bitcoin
    3. Search about the newer configuration options (ie. disablewallet is not listed in the wiki)
    4. Finally edit the file with your settings

    I believe that on installing Bitcoin Core, if no bitcoin.conf exists in %appdata%/Bitcoin a new one should be created with all options available in that release and some comments about every setting (like the wiki sample file).

    I dont know how to make a pull request for this idea.

  2. gmaxwell commented at 5:24 pm on March 19, 2014: contributor
    Eerk. Copying that “sample bitcoin.conf” is a really bad idea. If that is what users think they need to do then we should certantly do something.
  3. gmaxwell commented at 5:28 pm on March 19, 2014: contributor
    @drak I disagree strongly. The only thing the file should have by default should be rpcuser/rpcpassword, and they should not be generated by the user but generated by a secure RNG.
  4. laanwj commented at 5:43 pm on May 2, 2014: member

    Yes, ideally it would write an example configuration file with every option, except for rpcuser/rpcpassword, commented out like

    0# (description of option from --help message)
    1# option=(some default value for option)
    
  5. laanwj added the label Improvement on May 2, 2014
  6. laanwj added the label Priority Low on May 2, 2014
  7. paveljanik commented at 4:34 pm on November 6, 2014: contributor

    I have the same opinion. But I’ll write it from the beginning. Let’s describe what happens now with the current master.

    When the user first starts bitcoind, ~/.bitcoin is created and this is filled in:

     0pavel@linux-hshf:~/.bitcoin> l
     1total 4
     2drwxr-xr-x 1 pavel users   88 Nov  6 11:15 ./
     3drwxr-xr-x 1 pavel users  172 Nov  6 11:15 ../
     4drwx------ 1 pavel users   58 Nov  6 11:15 blocks/
     5drwx------ 1 pavel users   78 Nov  6 11:15 chainstate/
     6drwx------ 1 pavel users   28 Nov  6 11:15 database/
     7-rw------- 1 pavel users    0 Nov  6 11:15 db.log
     8-rw------- 1 pavel users 2059 Nov  6 11:15 debug.log
     9-rw------- 1 pavel users    0 Nov  6 11:15 .lock
    10pavel@linux-hshf:~/.bitcoin> 
    

    bitcoind prints this at the first run:

     0pavel@linux-hshf:~/bitcoin/src> ./bitcoind 
     1Error: To use the "-server" option, you must set a rpcpassword in the configuration file:
     2/home/pavel/.bitcoin/bitcoin.conf
     3It is recommended you use the following random password:
     4rpcuser=bitcoinrpc
     5rpcpassword=EwJeV3fZTyTVozdECF627BkBMnNDwQaVLakG3A4wXYyk
     6(you do not need to remember this password)
     7The username and password MUST NOT be the same.
     8If the file does not exist, create it with owner-readable-only file permissions.
     9It is also recommended to set alertnotify so you are notified of problems;
    10for example: alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com
    11pavel@linux-hshf:~/bitcoin/src> 
    

    So we are pre-filling the user directory and print him texts he could (we even recommend that) fill in the bitcoind.conf. This is quite good, but it would me more user friendly to pre-fill also these infos to the newly created bitcoind.conf. He still have to do something, but we could make it a lot easier for him if we pre-fill the file with this info, e.g. in this particular run of bitcoind, the bitcoin.conf file would end up with this:

    0# Generated rpcuser and rpcpassword
    1rpcuser=bitcoinrpc
    2rpcpassword=EwJeV3fZTyTVozdECF627BkBMnNDwQaVLakG3A4wXYyk
    

    I also think that the rest of the start message (alertnotify example) could go to this file (with maybe even more comments and samples) instead of printing it to the user. He is trying to run bitcoind for the first time (without arguments as I did above), doesn’t have rpcuser/password set up, so why bother him with the alertnotify at all?

    So in the future, it could work as follows:

    0$ ./bitcoind
    1Warning: rpcuser and rpcpassword were generated for your convenience (you can change it in ~/.bitcoin/bitcoind.conf).
    

    … and bitcoind is running.

  8. Alex-van-der-Peet referenced this in commit 4cf53d0f1e on Jun 9, 2015
  9. rebroad commented at 12:01 pm on June 12, 2015: contributor
    I think this is a great idea.
  10. laanwj commented at 2:28 pm on July 27, 2015: member
    Indirectly implemented by #6388
  11. laanwj closed this on Jul 27, 2015

  12. sidhujag referenced this in commit 1544ef2a2f on Dec 28, 2020
  13. MarcoFalke locked this on Sep 8, 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-10-04 22:12 UTC

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