dcrd/database/ffldb
Ryan Staudt bdccd3e3f7 database: Add Flush to DB interface.
This adds a Flush method to the DB interface so that users of the DB
type can flush the underlying database to disk as needed.

The immediate use case for this is to allow for flushing dependencies.
For example, the block database always needs to be flushed to disk prior
to the UTXO database being flushed to disk to ensure that the UTXO
database remains in a recoverable state in the event of an unclean
shutdown.
2021-05-13 22:43:30 -05:00
..
bench_test.go multi: Start dcrutil v4 module dev cycle. 2020-12-16 16:30:24 -06:00
blockio.go multi: update database error types. 2020-12-18 13:40:32 -06:00
db.go database: Add Flush to DB interface. 2021-05-13 22:43:30 -05:00
dbcache.go database: Add Flush to DB interface. 2021-05-13 22:43:30 -05:00
doc.go database: Replace with new version. 2016-08-23 17:40:38 -04:00
driver_test.go multi: update database error types. 2020-12-18 13:40:32 -06:00
driver.go multi: Correct typos. 2019-08-16 17:37:58 -05:00
export_test.go multi: Correct typos. 2019-08-16 17:37:58 -05:00
interface_test.go multi: update database error types. 2020-12-18 13:40:32 -06:00
ldbtreapiter.go multi: switch to syndtr/goleveldb 2020-01-28 16:57:18 -06:00
mockfile_test.go database: Replace with new version. 2016-08-23 17:40:38 -04:00
README.md multi: replace godoc.org with pkg.go.dev 2020-02-18 19:35:19 -06:00
reconcile.go multi: update database error types. 2020-12-18 13:40:32 -06:00
whitebox_test.go multi: update database error types. 2020-12-18 13:40:32 -06:00

ffldb

Build Status ISC License Doc

Package ffldb implements a driver for the database package that uses leveldb for the backing metadata and flat files for block storage.

This driver is the recommended driver for use with dcrd. It makes use leveldb for the metadata, flat files for block storage, and checksums in key areas to ensure data integrity.

Package ffldb is licensed under the copyfree ISC license.

Usage

This package is a driver to the database package and provides the database type of "ffldb". The parameters the Open and Create functions take are the database path as a string and the block network.

db, err := database.Open("ffldb", "path/to/database", wire.MainNet)
if err != nil {
	// Handle error
}
db, err := database.Create("ffldb", "path/to/database", wire.MainNet)
if err != nil {
	// Handle error
}

License

Package ffldb is licensed under the copyfree ISC License.