Dan Aharoni 8b2d3f07ce [NOD-636] Prevent db corruption on crash. (#607)
* [NOD-636] Scope err so defer anonymous defer function will get it.

* [NOD-636] Add comment to explain why this line is needed.

* [NOD-636] Edit comment.
2020-01-28 11:04:41 +02:00
..

ffldb

ISC License GoDoc

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 kaspad. It makes use of leveldb for the metadata, flat files for block storage, and checksums in key areas to ensure data integrity.

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
}