Skip to content

Instantly share code, notes, and snippets.

@willcl-ark
Created March 7, 2024 13:32
Show Gist options
  • Save willcl-ark/79557c965ba72362a47ec1e14f3a343a to your computer and use it in GitHub Desktop.
Save willcl-ark/79557c965ba72362a47ec1e14f3a343a to your computer and use it in GitHub Desktop.
[FILES]
.B Data directory
The data directory is the default location where the Bitcoin Core files are stored:
.RS
.TP
.B Linux
$HOME/.bitcoin/
.TP
.B macOS
$HOME/Library/Application Support/Bitcoin/
.TP
.B Windows
%APPDATA%\\\Bitcoin
.RE
.PP
.B Chain-specific data directory
.PP
All content of the data directory, except for the bitcoin.conf file, is chain-specific.
This means the actual data directory paths for non-mainnet cases differ:
.RS
.TP
.B Mainnet
*path_to_datadir*/
.TP
.B Testnet
*path_to_datadir*/testnet3
.TP
.B Signet
*path_to_datadir*/signet
.TP
.B Regtest
*path_to_datadir*/regtest
.RE
.PP
.B
.PP
.B Data directory layout
.RS
.TP
.B blocks/
Blocks directory; can be specified by \\fB\-blocksdir\\fP option (except for blocks/index/)
.TP
.B blocks/index/
LevelDB database for block index; \\fB\-blocksdir\\fP option does not affect this path
.TP
.B chainstate/
LevelDB database for blockchain state (a compact representation of all currently unspent transaction outputs (UTXOs) and metadata about the transactions they are from)
.TP
.B wallets/
Contains wallets; can be specified by \\fB\-walletdir\\fP option; if wallets/ subdirectory does not exist, wallets reside in the data directory
.TP
.B ./anchors.dat
Anchor IP address database, created on shutdown and deleted at startup.
Anchors are last known outgoing block-relay-only peers that are tried to reconnect to on startup)
.TP
.B ./banlist.json
Stores the addresses/subnets of banned nodes
.TP
.B ./bitcoin.conf
User-defined configuration settings for bitcoind or bitcoin-qt.
File is not written to by the software and must be created manually. Path can be specified by \\fB\-conf\\fP option
.TP
.B ./bitcoind.pid
Stores the process ID (PID) of bitcoind or bitcoin-qt while running; created at start and deleted on shutdown; can be specified by \\fB\-pid\\fP option
.TP
.B ./debug.log
Contains debug information and general logging generated by bitcoind or bitcoin-qt; can be specified by \\fP\-debuglogfile\\fP option
.TP
.B ./fee_estimates.dat
Stores statistics used to estimate minimum transaction fees required for confirmation
.TP
.B ./mempool.dat
Dump of the mempool's transactions
.TP
.B ./onion_v3_private_key
Cached Tor onion service private key for \\fB\-listenonion\\fP option
.TP
.B ./i2p_private_key
Private key that corresponds to our I2P address. When \\fB\-i2psam=\\fP is specified the contents of this file is used to identify ourselves for making outgoing connections to I2P peers and possibly accepting incoming ones.
Automatically generated if it does not exist.
.TP
.B ./peers.dat
Peer IP address database (custom format)
.TP
.B ./settings.json
Read-write settings set through GUI or RPC interfaces, augmenting manual settings from bitcoin.conf.
File is created automatically if read-write settings storage is not disabled with \\fB\-nosettings\\fP option. Path can be specified with \\fB\-settings\\fP option.
.TP
.B ./.cookie
Session RPC authentication cookie
.RE
.PP
.B
.PP
.B Berkeley DB database based wallets
.RS
.TP
.B database/
BDB logging files. Part of BDB environment; created at start and deleted on shutdown; a user *must keep it as safe* as personal wallet wallet.dat
.TP
.B ./db.log
BDB error file
.TP
.B ./wallet.dat
Personal wallet (a BDB database) with keys and transactions
.TP
.B ./walletlock
BDB wallet lock file
.RE
.PP
.B
.PP
.B SQLite database based wallets
.RS
.TP
.B ./wallet.dat
Personal wallet (a SQLite database) with keys and transactions
.TP
.B ./wallet.dat-journal
SQLite Rollback Journal file for wallet.dat. Usually created at start and deleted on shutdown. A user *must keep it as safe* as the wallet.dat file.
.RE
.PP
.B
.PP
.B GUI settings
bitcoin-qt uses QSettings, this implies platform-specific locations where application settings are stored.
Check https://doc.qt.io/qt-5/qsettings.html#locations-where-application-settings-are-stored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment