Add -chainstatedir and -blocksdir in bitcoin.conf #14595

issue Janaka-Steph openend this issue on October 28, 2018
  1. Janaka-Steph commented at 5:12 pm on October 28, 2018: none

    Hello!

    I am running a bitcoin core node on my macbook with datadir on an external hard drive. The sync performance wasn’t great so I searched to improve it and I found this thread #10647 (comment)

    Peter is suggesting to keep the chainstate on internal disk but only moving blocks on external disk. My question is, is there some plans to let user the possibility to specify that in the config file instead of creating symlink, having chainstatedir and blocksdir parameters in addition to datadir?

    Thank you

  2. hebasto commented at 9:02 pm on November 3, 2018: member
    -blocksdir option has been already supported by the command line and/or bitcoin.conf file. See: #12653
  3. Janaka-Steph commented at 6:13 pm on November 5, 2018: none

    spec: Bitcoin 0.17.0, Mac OSX @hebasto Oh ok I didn’t know that, thank you. However I tried to add blocksdir to my config file and it is not taken into account. I first tried to add blocksdir under sections [main] and [test]. This doesn’t work. And having a global blocksdir doesn’t work either.

    I have an additional issue with regtest. I want to keep the default data directory but when I run bitcoind, it will create an empty blocks folder at the root of the bitcoin directory in addition to a blocks folder in the regtest directory. It seems that bitcoind in regtest will first search for a blocks dir as if it was on mainnet. It forces me to plug my external hard drive even if I work on regtest. Specifying datadir or blocksdir in [regtest] to avoid this unwanted behavior doesn’t work.

  4. hebasto commented at 7:49 pm on November 5, 2018: member

    @Janaka-Steph

    However I tried to add blocksdir to my config file and it is not taken into account. I first tried to add blocksdir under sections [main] and [test]. This doesn’t work. And having a global blocksdir doesn’t work either.

    Can you provide your bitcoin.conf file here?

    I have an additional issue with regtest. I want to keep the default data directory but when I run bitcoind, it will create an empty blocks folder at the root of the bitcoin directory in addition to a blocks folder in the regtest directory.

    The #14409 patch fixes this issue.

  5. Janaka-Steph commented at 9:48 pm on November 5, 2018: none

    Here is my bitcoin conf file. blocksdir is commented. I tried different things but can’t have it working.

      0# This config should be placed in following path on Mac OSX:
      1# $HOME/Library/Application Support/Bitcoin/bitcoin.conf
      2
      3###
      4#[core]
      5
      6#regtest=1
      7testnet=1
      8
      9# Maintain a full transaction index, used by the getrawtransaction rpc call.
     10txindex=1
     11
     12# Specify a non-default location to store blockchain and other data.
     13# Default location on Mac OSX: $HOME/Library/Application Support/Bitcoin
     14# Having chainstate on external HD hurts performance badly, see [#10647 (comment)](/bitcoin-bitcoin/10647/#issuecomment-312466993)
     15# datadir=/Volumes/Blockchains/Bitcoin
     16
     17# Configuration file location
     18# conf=/Users/steph/Library/Application Support/Bitcoin/bitcoin.conf
     19
     20# Set database cache size in megabytes; machines sync faster with a larger cache
     21# Recommend setting as high as possible based upon machine's available RAM
     22dbcache=10000
     23
     24# Append comment to the user agent string
     25uacomment=fuckTheBanks
     26
     27
     28###
     29#[zeromq]
     30# Enable publishing of block hashes to <address>.
     31zmqpubhashblock=tcp://127.0.0.1:30001
     32
     33# Enable publishing of transaction hashes to <address>.
     34zmqpubhashtx=tcp://127.0.0.1:30001
     35
     36
     37
     38###
     39#[debug]
     40# Categories: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb
     41debug=1
     42# Log IP Addresses in debug output.
     43logips=1
     44
     45
     46# [network]
     47# Automatically create Tor hidden service
     48# listenonion=0
     49# Use UPnP to map the listening port
     50upnp=1
     51
     52
     53###
     54#[rpc]
     55# Accept command line and JSON-RPC commands.
     56server=1
     57
     58# Accept public REST requests.
     59rest=1
     60
     61# Secure the JSON-RPC api. Deprecated method, use rpcauth instead
     62#rpcuser=user
     63#If no rpcpassword is set, rpc cookie auth is sought
     64#rpcpassword=lulz
     65
     66# Location of the RPC auth cookie
     67#rpccookiefile=/Users/steph/Library/Application\ Support/Bitcoin/regtest/.cookie
     68
     69# Username and hashed password for JSON-RPC connections. <USERNAME>:<SALT>$<HASH>
     70# RPC clients connect using rpcuser=<USERNAME>/rpcpassword=<PASSWORD> arguments.
     71# You can generate this value with the ./share/rpcauth/rpcauth.py script in the Bitcoin Core repository
     72# rpcauth=stephane:c2aab19c89911bdeae44792ad23a8edb$e1057aa437fb1b6466de687f697b6ba8ea6fd3807b9b5bf38e972771ad4c6ce2
     73
     74# Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times.
     75#rpcallowip=127.0.0.1
     76
     77
     78###
     79# [wallet]
     80# Send transactions with full-RBF (bip125-replaceable), activated by default. Use bumpfee "txid" to replace a tx.
     81walletrbf=1
     82
     83#disablewallet=1
     84
     85
     86
     87###
     88# Network specific sections
     89# https://bitcoin.org/en/release/v0.17.0#configuration-sections-for-testnet-and-regtest
     90[main]
     91#blocksdir=/Volumes/Blockchains/Bitcoin
     92
     93# Bitcoin network protocol listen port (default 8333)
     94#port=8333
     95
     96# RPC connection port (default 8332)
     97#rpcport=8332
     98
     99#mempoolsize=300
    100
    101
    102
    103[test]
    104#blocksdir=/Volumes/Blockchains/Bitcoin
    105
    106# Bitcoin network protocol listen port (default 18333)
    107port=18401
    108
    109# RPC connection port (default 18332)
    110#rpcport=18332
    111
    112#mempoolsize=100
    113
    114# Fees (in BTC/kB) smaller than this are considered zero fee for transaction creation (default: 0.00001)
    115mintxfee=0.001
    116
    117# Fee (in BTC/kB) to add to transactions you send (default: 0.00)
    118#paytxfee=0.001
    119
    120# If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: 6)
    121txconfirmtarget=1
    122
    123# Specify a non-default location to store wallet data.
    124# walletdir=/Users/steph/Library/Application Support/Bitcoin/testnet3/wallet1
    125
    126
    127
    128[regtest]
    129#blocksdir=/Volumes/Blockchains/Bitcoin
    130
    131# Bitcoin network protocol listen port (default 18444)
    132#port=18444
    133
    134# RPC connection port (default 18443)
    135#rpcport=18443
    136
    137# Location of the RPC auth cookie
    138# rpccookiefile=/Users/steph/Desktop/Bitcoin/Regtest_Server/.cookie
    139
    140# Set the depth of the work queue to service RPC calls
    141rpcworkqueue=32
    142
    143#mempoolsize=20
    
  6. hebasto commented at 4:27 pm on November 30, 2018: member

    @Janaka-Steph I’ve tested your config file on MacOS 10.13.6:

    0...
    1testnet=1
    2...
    3[test]
    4#blocksdir=/Volumes/Blockchains/Bitcoin
    5blocksdir=/Users/hebasto/Desktop/BLOCKS
    6...
    

    It works as expected for me:

    0$ ls /Users/hebasto/Desktop/BLOCKS/testnet3/
    1blocks
    
  7. Janaka-Steph commented at 12:15 pm on January 11, 2019: none
    Hello, Sorry for the delay. I have tested again the blocksdir option in conf file test section, on Mac 10.14.2 and Core 0.17.1, and it works. Blocks are written on my external HD.
  8. Janaka-Steph closed this on Jan 11, 2019

  9. laanwj referenced this in commit 64ee94356f on Jan 16, 2019
  10. PastaPastaPasta referenced this in commit c1d86731ef on Jun 26, 2021
  11. PastaPastaPasta referenced this in commit a8c5821419 on Jun 27, 2021
  12. PastaPastaPasta referenced this in commit b12c459007 on Jun 28, 2021
  13. DrahtBot locked this on Dec 16, 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