mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
ad73978530
54133c59b80ccac85eaebb0668cd2f0fe360b323 doc: add indexes/coinstats/db/ to files.md (Jon Atack) 5d1050f51647980b1204e3b44b319ab31948d11f doc: fix -coinstatsindex help, and test/rpc touchups (Jon Atack) e041ee0a80e5f3e10301acf8512a18864af750cd doc: add coinstatsindex to bitcoin.conf (Jon Atack) Pull request description: ACKs for top commit: Sjors: utACK 54133c59b80ccac85eaebb0668cd2f0fe360b323 MarcoFalke: cr ACK 54133c59b80ccac85eaebb0668cd2f0fe360b323 clarkmoody: utACK 54133c5 Tree-SHA512: 1a7f3e89873b7dc79ec71d5d39e9e3e4977ce43cc4bee208ad55291bef1bb319a9d1c34ed84a87d6a803db983bdfd0af4d9f396cec0bec86b1701ebbb6f34378
133 lines
9.5 KiB
Markdown
133 lines
9.5 KiB
Markdown
# Dash Core file system
|
|
|
|
**Contents**
|
|
|
|
- [Data directory location](#data-directory-location)
|
|
|
|
- [Data directory layout](#data-directory-layout)
|
|
|
|
- [Multi-wallet environment](#multi-wallet-environment)
|
|
|
|
- [Berkeley DB database based wallets](#berkeley-db-database-based-wallets)
|
|
|
|
- [SQLite database based wallets](#sqlite-database-based-wallets)
|
|
|
|
- [GUI settings](#gui-settings)
|
|
|
|
- [Legacy subdirectories and files](#legacy-subdirectories-and-files)
|
|
|
|
- [Notes](#notes)
|
|
|
|
## Data directory location
|
|
|
|
The data directory is the default location where the Dash Core files are stored.
|
|
|
|
1. The default data directory paths for supported platforms are:
|
|
|
|
Platform | Data directory path
|
|
---------|--------------------
|
|
Linux | `$HOME/.dashcore/`
|
|
macOS | `$HOME/Library/Application Support/Dashcore/`
|
|
Windows | `%APPDATA%\Dashcore\` <sup>[\[1\]](#note1)</sup>
|
|
|
|
2. A custom data directory path can be specified with the `-datadir` option.
|
|
|
|
3. All content of the data directory, except for `dash.conf` file, is chain-specific. This means the actual data directory paths for non-mainnet cases differ:
|
|
|
|
Chain option | Data directory path
|
|
-------------------------------|------------------------------
|
|
`-chain=main` (default) | *path_to_datadir*`/`
|
|
`-chain=test` or `-testnet` | *path_to_datadir*`/testnet3/`
|
|
`-chain=devnet` or `-devnet` | *path_to_datadir*`/devnet/`
|
|
`-chain=regtest` or `-regtest` | *path_to_datadir*`/regtest/`
|
|
|
|
## Data directory layout
|
|
|
|
Subdirectory | File(s) | Description
|
|
-------------------|-----------------------|------------
|
|
`blocks/` | | Blocks directory; can be specified by `-blocksdir` option (except for `blocks/index/`)
|
|
`blocks/index/` | LevelDB database | Block index; `-blocksdir` option does not affect this path
|
|
`blocks/` | `blkNNNNN.dat`<sup>[\[2\]](#note2)</sup> | Actual Dash blocks (in network format, dumped in raw on disk, 128 MiB per file)
|
|
`blocks/` | `revNNNNN.dat`<sup>[\[2\]](#note2)</sup> | Block undo data (custom format)
|
|
`chainstate/` | LevelDB database | Blockchain state (a compact representation of all currently unspent transaction outputs (UTXOs) and metadata about the transactions they are from)
|
|
`indexes/txindex/` | LevelDB database | Transaction index; *optional*, used if `-txindex=1`
|
|
`indexes/blockfilter/basic/db/` | LevelDB database | Blockfilter index LevelDB database for the basic filtertype; *optional*, used if `-blockfilterindex=basic`
|
|
`indexes/blockfilter/basic/` | `fltrNNNNN.dat`<sup>[\[2\]](#note2)</sup> | Blockfilter index filters for the basic filtertype; *optional*, used if `-blockfilterindex=basic`
|
|
`indexes/coinstats/db/` | LevelDB database | Coinstats index; *optional*, used if `-coinstatsindex=1`
|
|
`wallets/` | | [Contains wallets](#multi-wallet-environment); can be specified by `-walletdir` option; if `wallets/` subdirectory does not exist, wallets reside in the [data directory](#data-directory-location)
|
|
`./` | `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 re-connect to on startup
|
|
`evodb/` | |special txes and quorums database
|
|
`llmq/` | |quorum signatures database
|
|
`./` | `banlist.json` | Stores the addresses/subnets of banned nodes.
|
|
`./` | `dash.conf` | User-defined [configuration settings](dash-conf.md) for `dashd` or `dash-qt`. File is not written to by the software and must be created manually. Path can be specified by `-conf` option
|
|
`./` | `dashd.pid` | Stores the process ID (PID) of `dashd` or `dash-qt` while running; created at start and deleted on shutdown; can be specified by `-pid` option
|
|
`./` | `debug.log` | Contains debug information and general logging generated by `dashd` or `dash-qt`; can be specified by `-debuglogfile` option
|
|
`./` | `governance.dat` | stores data for governance objects
|
|
`./` | `mncache.dat` | stores data for masternode list
|
|
`./` | `netfulfilled.dat` | stores data about recently made network requests
|
|
`./` | `fee_estimates.dat` | Stores statistics used to estimate minimum transaction fees and priorities required for confirmation
|
|
`./` | `guisettings.ini.bak` | Backup of former [GUI settings](#gui-settings) after `-resetguisettings` option is used
|
|
`./` | `ip_asn.map` | IP addresses to Autonomous System Numbers (ASNs) mapping used for bucketing of the peers; path can be specified with the `-asmap` option
|
|
`./` | `mempool.dat` | Dump of the mempool's transactions
|
|
`./` | `onion_v3_private_key` | Cached Tor onion service private key for `-listenonion` option
|
|
`./` | `i2p_private_key` | Private key that corresponds to our I2P address. When `-i2psam=` 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.
|
|
`./` | `peers.dat` | Peer IP address database (custom format)
|
|
`./` | `settings.json` | Read-write settings set through GUI or RPC interfaces, augmenting manual settings from [dash.conf](dash-conf.md). File is created automatically if read-write settings storage is not disabled with `-nosettings` option. Path can be specified with `-settings` option
|
|
`./` | `.cookie` | Session RPC authentication cookie; if used, created at start and deleted on shutdown; can be specified by `-rpccookiefile` option
|
|
`./` | `.lock` | Data directory lock file
|
|
|
|
## Multi-wallet environment
|
|
|
|
Wallets are Berkeley DB (BDB) or SQLite databases.
|
|
|
|
1. Each user-defined wallet named "wallet_name" resides in the `wallets/wallet_name/` subdirectory.
|
|
|
|
2. The default (unnamed) wallet resides in `wallets/` subdirectory; if the latter does not exist, the wallet resides in the data directory.
|
|
|
|
3. A wallet database path can be specified with the `-wallet` option.
|
|
|
|
4. `wallet.dat` files must not be shared across different node instances, as that can result in key-reuse and double-spends due the lack of synchronization between instances.
|
|
|
|
5. Any copy or backup of the wallet should be done through a `backupwallet` call in order to update and lock the wallet, preventing any file corruption caused by updates during the copy.
|
|
|
|
|
|
### Berkeley DB database based wallets
|
|
|
|
Subdirectory | File(s) | Description
|
|
-------------|-------------------|-------------
|
|
`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`
|
|
`./` | `db.log` | BDB error file
|
|
`./` | `wallet.dat` | Personal wallet (a BDB database) with keys and transactions
|
|
`./` | `.walletlock` | BDB wallet lock file
|
|
|
|
### SQLite database based wallets
|
|
|
|
Subdirectory | File | Description
|
|
-------------|----------------------|-------------
|
|
`./` | `wallet.dat` | Personal wallet (a SQLite database) with keys and transactions
|
|
`./` | `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.
|
|
|
|
|
|
## GUI settings
|
|
|
|
`dash-qt` uses [`QSettings`](https://doc.qt.io/qt-5/qsettings.html) class; this implies platform-specific [locations where application settings are stored](https://doc.qt.io/qt-5/qsettings.html#locations-where-application-settings-are-stored).
|
|
|
|
## Legacy subdirectories and files
|
|
|
|
These subdirectories and files are no longer used by Dash Core:
|
|
|
|
Path | Description | Repository notes
|
|
---------------|-------------|-----------------
|
|
`banlist.dat` | Stores the addresses/subnets of banned nodes; completely ignored and superseded by `banlist.json` in 20.0 | [PR #5574](https://github.com/dashpay/dash/pull/5574)
|
|
`blktree/` | Blockchain index; replaced by `blocks/index/` in [0.8.0](https://github.com/dash/dash/blob/master/doc/release-notes/release-notes-0.8.0.md#improvements) | [PR #2231](https://github.com/dash/dash/pull/2231), [`8fdc94cc`](https://github.com/dash/dash/commit/8fdc94cc8f0341e96b1edb3a5b56811c0b20bd15)
|
|
`coins/` | Unspent transaction output database; replaced by `chainstate/` in 0.8.0 | [PR #2231](https://github.com/dash/dash/pull/2231), [`8fdc94cc`](https://github.com/dash/dash/commit/8fdc94cc8f0341e96b1edb3a5b56811c0b20bd15)
|
|
`blkindex.dat` | Blockchain index BDB database; replaced by {`chainstate/`, `blocks/index/`, `blocks/revNNNNN.dat`<sup>[\[2\]](#note2)</sup>} in 0.8.0 | [PR #1677](https://github.com/dash/dash/pull/1677)
|
|
`blk000?.dat` | Block data (custom format, 2 GiB per file); replaced by `blocks/blkNNNNN.dat`<sup>[\[2\]](#note2)</sup> in 0.8.0 | [PR #1677](https://github.com/dash/dash/pull/1677)
|
|
`addr.dat` | Peer IP address BDB database; replaced by `peers.dat` in [0.7.0](https://github.com/dash/dash/blob/master/doc/release-notes/release-notes-0.7.0.md) | [PR #1198](https://github.com/dash/dash/pull/1198), [`928d3a01`](https://github.com/dash/dash/commit/928d3a011cc66c7f907c4d053f674ea77dc611cc)
|
|
|
|
## Notes
|
|
|
|
<a name="note1">1</a>. The `/` (slash, U+002F) is used as the platform-independent path component separator in this document.
|
|
|
|
<a name="note2">2</a>. `NNNNN` matches `[0-9]{5}` regex.
|