github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/database/README.md (about) 1 database 2 ======== 3 4 [![Build Status](http://img.shields.io/travis/dashpay/godash.svg)] 5 (https://travis-ci.org/dashpay/godash) [![ISC License] 6 (http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) 7 [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)] 8 (http://godoc.org/github.com/dashpay/godash/database) 9 10 Package database provides a block and metadata storage database. 11 12 Please note that this package is intended to enable btcd to support different 13 database backends and is not something that a client can directly access as only 14 one entity can have the database open at a time (for most database backends), 15 and that entity will be btcd. 16 17 When a client wants programmatic access to the data provided by btcd, they'll 18 likely want to use the [btcrpcclient](https://github.com/btcsuite/btcrpcclient) 19 package which makes use of the [JSON-RPC API] 20 (https://github.com/dashpay/godash/tree/master/docs/json_rpc_api.md). 21 22 However, this package could be extremely useful for any applications requiring 23 Bitcoin block storage capabilities. 24 25 The default backend, ffldb, has a strong focus on speed, efficiency, and 26 robustness. It makes use of leveldb for the metadata, flat files for block 27 storage, and strict checksums in key areas to ensure data integrity. 28 29 ## Feature Overview 30 31 - Key/value metadata store 32 - Bitcoin block storage 33 - Efficient retrieval of block headers and regions (transactions, scripts, etc) 34 - Read-only and read-write transactions with both manual and managed modes 35 - Nested buckets 36 - Iteration support including cursors with seek capability 37 - Supports registration of backend databases 38 - Comprehensive test coverage 39 40 ## Installation and Updating 41 42 ```bash 43 $ go get -u github.com/dashpay/godash/database 44 ``` 45 46 ## Examples 47 48 * [Basic Usage Example] 49 (http://godoc.org/github.com/dashpay/godash/database#example-package--BasicUsage) 50 Demonstrates creating a new database and using a managed read-write 51 transaction to store and retrieve metadata. 52 53 * [Block Storage and Retrieval Example] 54 (http://godoc.org/github.com/dashpay/godash/database#example-package--BlockStorageAndRetrieval) 55 Demonstrates creating a new database, using a managed read-write transaction 56 to store a block, and then using a managed read-only transaction to fetch the 57 block. 58 59 ## License 60 61 Package database is licensed under the [copyfree](http://copyfree.org) ISC 62 License.