Changeset View
Changeset View
Standalone View
Standalone View
doc/files.md
# Bitcoin ABC file system | # Bitcoin ABC file system | ||||
**Contents** | **Contents** | ||||
- [Data directory location](#data-directory-location) | - [Data directory location](#data-directory-location) | ||||
- [Data directory layout](#data-directory-layout) | - [Data directory layout](#data-directory-layout) | ||||
- [Multi-wallet environment](#multi-wallet-environment) | - [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) | - [GUI settings](#gui-settings) | ||||
- [Legacy subdirectories and files](#legacy-subdirectories-and-files) | - [Legacy subdirectories and files](#legacy-subdirectories-and-files) | ||||
- [Notes](#notes) | - [Notes](#notes) | ||||
## Data directory location | ## Data directory location | ||||
Show All 40 Lines | |||||
`./` | `onion_v3_private_key` | Cached Tor onion service private key for `-listenonion` option | `./` | `onion_v3_private_key` | Cached Tor onion service private key for `-listenonion` option | ||||
`./` | `peers.dat` | Peer IP address database (custom format) | `./` | `peers.dat` | Peer IP address database (custom format) | ||||
`./` | `settings.json` | Read-write settings set through GUI or RPC interfaces, augmenting manual settings from [bitcoin.conf](bitcoin-conf.md). File is created automatically if read-write settings storage is not disabled with `-nosettings` option. Path can be specified with `-settings` option | `./` | `settings.json` | Read-write settings set through GUI or RPC interfaces, augmenting manual settings from [bitcoin.conf](bitcoin-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 | `./` | `.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 | `./` | `.lock` | Data directory lock file | ||||
## Multi-wallet environment | ## Multi-wallet environment | ||||
Wallets are Berkeley DB (BDB) databases: | Wallets are Berkeley DB (BDB) or SQLite databases. | ||||
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 (BDB) with keys and transactions | |||||
`./` | `.walletlock` | Wallet lock file | |||||
1. Each user-defined wallet named "wallet_name" resides in `wallets/wallet_name/` subdirectory. | 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. | 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 by `-wallet` option. | 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. | 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. | 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 | ## GUI settings | ||||
`bitcoin-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). | `bitcoin-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 | ## Legacy subdirectories and files | ||||
These subdirectories and files are no longer used by the Bitcoin ABC: | These subdirectories and files are no longer used by the Bitcoin ABC: | ||||
Show All 15 Lines |