Strange -blocksdir behavior #12828

issue Sjors openend this issue on March 29, 2018
  1. Sjors commented at 12:52 pm on March 29, 2018: member

    A bit late to the party, but I just tried #12653 and noticed some non-intuitive behavior (on macOS), that’s probably worth explaining release notes and help.

    Before this new feature I kept the entire datadir on an SSD drive, so I launch with: bitcoind -datadir=/Volumes/SSD/Bitcoin.

    Initially I naively moved /Volumes/SSD/Bitcoin/blocks to /Users/bitcoin/blocks and added a line to /Volumes/SSD/Bitcoin/bitcoin.conf: blocksdir=/Users/bitcoin/blocks.

    I then realized that I shouldn’t have moved the index subdirectory, so I moved that back to /Volumes/SSD/Bitcoin/blocks/index. Having an empty blocks dir with just and index subdir is a bit weird. Perhaps after @jimpo’s #11857 is merged, we could just move / assume all indexes to be there (if -blocksdir is set)?

    Worse, it created a directory /Users/bitcoin/blocks/blocks, which seems like a bug. I had to set blocksdir=/Users/bitcoin instead.

  2. fanquake added the label Block storage on Mar 29, 2018
  3. MarcoFalke added this to the milestone 0.17.0 on Mar 29, 2018
  4. jnewbery commented at 2:31 pm on March 29, 2018: member
    was that a deliberate bocks/blocks typo?
  5. Sjors commented at 3:13 pm on March 29, 2018: member
    @jnewbery fixed typos…
  6. Sjors commented at 7:20 pm on May 6, 2018: member
    I forgot about this, but then noticed it again today as I was playing with Docker. When allocating a separate volume for block storage, which is very useful, the files end up in a blocks directory inside that volume rather than at the root. Not the end of the world, but not a quirk I’d like to support for eternity.
  7. Sjors commented at 2:08 pm on July 25, 2018: member

    Actually this behavior makes sense, but could be better documented:

    If you enable testnet, it will use blocksdir/testnet3/blocks, so blocksdir/blocks is appropriate for mainnet. But maybe it should be called blockstorageroot or something.

  8. MarcoFalke added the label Docs on Jul 29, 2018
  9. MarcoFalke removed this from the milestone 0.17.0 on Jul 29, 2018
  10. MarcoFalke commented at 5:46 pm on July 29, 2018: member
    Yes, if the help string doesn’t mention that yet, then maybe it should.
  11. Sjors commented at 9:04 am on July 30, 2018: member
    0  -blocksdir=<dir>
    1       Specify blocks directory (default: <datadir>/blocks)
    

    That’s not very clear, though not sure how to rephrase it.

  12. MarcoFalke referenced this in commit 667a861741 on May 13, 2019
  13. MarcoFalke closed this on May 13, 2019

  14. sidhujag referenced this in commit 627c65b09b on May 14, 2019
  15. PastaPastaPasta referenced this in commit c0a6e3328e on Jun 27, 2021
  16. PastaPastaPasta referenced this in commit a947a1ac89 on Jun 28, 2021
  17. PastaPastaPasta referenced this in commit 5ad8f68ebb on Jun 29, 2021
  18. PastaPastaPasta referenced this in commit 82f971760f on Jul 1, 2021
  19. PastaPastaPasta referenced this in commit ace7367e89 on Jul 1, 2021
  20. PastaPastaPasta referenced this in commit e70305c97a on Jul 8, 2021
  21. PastaPastaPasta referenced this in commit 7dee7786b7 on Jul 10, 2021
  22. Fonta1n3 commented at 2:12 pm on September 23, 2021: none

    @Sjors I am still experiencing issues with this… I set blocksdir=/Users/me/Desktop in my conf and yet when I boot up it still creates a new block dir in the default location and tells me I need to reindex :( v22.0

    It seems to completely ignore the config setting, please see log output:

     02021-09-23T14:05:52Z Bitcoin Core version v22.0.0 (release build)
     12021-09-23T14:05:52Z InitParameterInteraction: parameter interaction: -proxy set -> setting -upnp=0
     22021-09-23T14:05:52Z InitParameterInteraction: parameter interaction: -proxy set -> setting -natpmp=0
     32021-09-23T14:05:52Z Assuming ancestors of block 00000000000000000008a89e854d57e5667df88f1cdef6fde2fbca1de5b639ad have valid signatures.
     42021-09-23T14:05:52Z Setting nMinimumChainWork=00000000000000000000000000000000000000001fa4663bbbe19f82de910280
     52021-09-23T14:05:52Z Prune configured to target 10000 MiB on disk for block and undo files.
     62021-09-23T14:05:52Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
     72021-09-23T14:05:52Z Default data directory /Users/fontaine/Library/Application Support/Bitcoin
     82021-09-23T14:05:52Z Using data directory /Users/fontaine/Library/Application Support/Bitcoin
     92021-09-23T14:05:52Z Config file: /Users/fontaine/Library/Application Support/Bitcoin/bitcoin.conf
    102021-09-23T14:05:52Z Config file arg: blocksdir="/Users/fontaine/Desktop"
    112021-09-23T14:05:52Z Config file arg: dbcache="3816"
    122021-09-23T14:05:52Z Config file arg: disablewallet="0"
    132021-09-23T14:05:52Z Config file arg: discover="0"
    142021-09-23T14:05:52Z Config file arg: fallbackfee="0.00009"
    152021-09-23T14:05:52Z Config file arg: listen="1"
    162021-09-23T14:05:52Z Config file arg: maxconnections="20"
    172021-09-23T14:05:52Z Config file arg: maxuploadtarget="500"
    182021-09-23T14:05:52Z Config file arg: onlynet="onion"
    192021-09-23T14:05:52Z Config file arg: proxy="127.0.0.1:19150"
    202021-09-23T14:05:52Z Config file arg: prune="10000"
    212021-09-23T14:05:52Z Config file arg: rpcallowip="127.0.0.1"
    222021-09-23T14:05:52Z Config file arg: rpcpassword=****
    232021-09-23T14:05:52Z Config file arg: rpcuser=****
    242021-09-23T14:05:52Z Config file arg: server="1"
    252021-09-23T14:05:52Z Config file arg: txindex="0"
    262021-09-23T14:05:52Z Config file arg: [main] externalip="rgvn57j6b6ldwg3o55rqykgmli4idpagkvdaj2nlhlekxrqle2fo5mqd.onion"
    272021-09-23T14:05:52Z Config file arg: [main] rpcport="8332"
    282021-09-23T14:05:52Z Config file arg: [main] rpcwhitelist="reCAfdl6WO:importdescriptors, getblockcount, abortrescan, listlockunspent, lockunspent, getbestblockhash, getaddressesbylabel, listlabels, decodescript, combinepsbt, utxoupdatepsbt, listaddressgroupings, converttopsbt, getaddressinfo, analyzepsbt, createpsbt, joinpsbts, getmempoolinfo, signrawtransactionwithkey, listwallets, unloadwallet, rescanblockchain, listwalletdir, loadwallet, createwallet, finalizepsbt, walletprocesspsbt, decodepsbt, walletcreatefundedpsbt, fundrawtransaction, uptime, importmulti, getdescriptorinfo, deriveaddresses, getrawtransaction, decoderawtransaction, getnewaddress, gettransaction, signrawtransactionwithwallet, createrawtransaction, getrawchangeaddress, getwalletinfo, getblockchaininfo, getbalance, getunconfirmedbalance, listtransactions, listunspent, bumpfee, importprivkey, abandontransaction, getpeerinfo, getnetworkinfo, getmininginfo, estimatesmartfee, sendrawtransaction, importaddress, signmessagewithprivkey, verifymessage, signmessage, encryptwallet, walletpassphrase, walletlock, walletpassphrasechange, gettxoutsetinfo, help, stop, gettxout, getblockhash"
    292021-09-23T14:05:52Z Config file arg: [regtest] rpcport="18443"
    302021-09-23T14:05:52Z Config file arg: [signet] externalip="s5txouexalzkifm4mc2xiic2el32w45aaowh4dly57p6d6vbggwwbgyd.onion"
    312021-09-23T14:05:52Z Config file arg: [signet] rpcport="38332"
    322021-09-23T14:05:52Z Config file arg: [test] externalip="zwlxnu6yds26jovfl3wb7xfcefcuq72rmc37o762inbdfijdrj4z5pqd.onion"
    332021-09-23T14:05:52Z Config file arg: [test] rpcport="18332"
    342021-09-23T14:05:52Z Command-line arg: daemon=""
    352021-09-23T14:05:52Z Using at most 20 automatic connections (188898 file descriptors available)
    362021-09-23T14:05:52Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
    372021-09-23T14:05:52Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
    382021-09-23T14:05:52Z Script verification uses 7 additional threads
    392021-09-23T14:05:52Z scheduler thread start
    402021-09-23T14:05:52Z WARNING: option -rpcallowip was specified without -rpcbind; this doesn't usually make sense
    412021-09-23T14:05:52Z HTTP: creating work queue of depth 16
    422021-09-23T14:05:52Z Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcauth for rpcauth auth generation.
    432021-09-23T14:05:52Z HTTP: starting 4 worker threads
    442021-09-23T14:05:52Z Using wallet directory /Users/fontaine/Library/Application Support/Bitcoin
    452021-09-23T14:05:52Z init message: Verifying wallet(s)
    462021-09-23T14:05:52Z init message: Loading banlist
    472021-09-23T14:05:52Z SetNetworkActive: true
    482021-09-23T14:05:52Z AddLocal(rgvn57j6b6ldwg3o55rqykgmli4idpagkvdaj2nlhlekxrqle2fo5mqd.onion:8333,4)
    492021-09-23T14:05:52Z Using /16 prefix for IP bucketing
    502021-09-23T14:05:52Z Cache configuration:
    512021-09-23T14:05:52Z * Using 2.0 MiB for block index database
    522021-09-23T14:05:52Z * Using 8.0 MiB for chain state database
    532021-09-23T14:05:52Z * Using 3806.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
    542021-09-23T14:05:52Z init message: Loading block index
    552021-09-23T14:05:52Z Switching active chainstate to Chainstate [ibd] @ height -1 (null)
    562021-09-23T14:05:52Z Opening LevelDB in /Users/fontaine/Library/Application Support/Bitcoin/blocks/index
    572021-09-23T14:05:52Z Opened LevelDB successfully
    582021-09-23T14:05:52Z Using obfuscation key for /Users/fontaine/Library/Application Support/Bitcoin/blocks/index: 0000000000000000
    592021-09-23T14:05:52Z LoadBlockIndexDB: last block file = 0
    602021-09-23T14:05:52Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
    612021-09-23T14:05:52Z Checking all blk files are present...
    622021-09-23T14:05:52Z Initializing databases...
    632021-09-23T14:05:52Z Opening LevelDB in /Users/fontaine/Library/Application Support/Bitcoin/chainstate
    642021-09-23T14:05:52Z Opened LevelDB successfully
    652021-09-23T14:05:52Z Using obfuscation key for /Users/fontaine/Library/Application Support/Bitcoin/chainstate: 9ef4d9c82c4d78f0
    662021-09-23T14:05:52Z : Error initializing block database.
    67Please restart with -reindex or -reindex-chainstate to recover.
    682021-09-23T14:05:52Z Aborted block database rebuild. Exiting.
    692021-09-23T14:05:52Z Shutdown: In progress...
    702021-09-23T14:05:52Z scheduler thread exit
    712021-09-23T14:05:52Z FlushStateToDisk: write coins cache to disk (0 coins, 0kB) started
    722021-09-23T14:05:52Z FlushStateToDisk: write coins cache to disk (0 coins, 0kB) completed (0.00s)
    732021-09-23T14:05:52Z FlushStateToDisk: write coins cache to disk (0 coins, 0kB) started
    742021-09-23T14:05:52Z FlushStateToDisk: write coins cache to disk (0 coins, 0kB) completed (0.00s)
    752021-09-23T14:05:52Z Shutdown: done
    
  23. Fonta1n3 commented at 2:24 pm on September 23, 2021: none
    Ah… I did the same thing as Sjors, I had ignorantly moved my existing blocks folder, the fix is moving the index folder from within the actual blocks folder to the dummy blocks folder in the default location.
  24. gades referenced this in commit bb869732b3 on May 29, 2022
  25. DrahtBot locked this on Oct 30, 2022

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-12-22 00:12 UTC

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