github.com/btcsuite/btcwallet/walletdb@v1.4.2/README.md (about)

     1  walletdb
     2  ========
     3  
     4  [![Build Status](https://travis-ci.org/btcsuite/btcwallet.png?branch=master)]
     5  (https://travis-ci.org/btcsuite/btcwallet)
     6  
     7  Package walletdb provides a namespaced database interface for btcwallet.
     8  
     9  A wallet essentially consists of a multitude of stored data such as private
    10  and public keys, key derivation bits, pay-to-script-hash scripts, and various
    11  metadata.  One of the issues with many wallets is they are tightly integrated.
    12  Designing a wallet with loosely coupled components that provide specific
    13  functionality is ideal, however it presents a challenge in regards to data
    14  storage since each component needs to store its own data without knowing the
    15  internals of other components or breaking atomicity.
    16  
    17  This package solves this issue by providing a namespaced database interface that
    18  is intended to be used by the main wallet daemon.  This allows the potential for
    19  any backend database type with a suitable driver.  Each component, which will
    20  typically be a package, can then implement various functionality such as address
    21  management, voting pools, and colored coin metadata in their own namespace
    22  without having to worry about conflicts with other packages even though they are
    23  sharing the same database that is managed by the wallet.
    24  
    25  A suite of tests is provided to ensure proper functionality.  See
    26  `test_coverage.txt` for the gocov coverage report.  Alternatively, if you are
    27  running a POSIX OS, you can run the `cov_report.sh` script for a real-time
    28  report.  Package walletdb is licensed under the copyfree ISC license.
    29  
    30  This interfaces provided by this package were heavily inspired by the excellent
    31  boltdb project at https://github.com/boltdb/bolt by Ben B. Johnson.
    32  
    33  ## Feature Overview
    34  
    35  - Key/value store
    36  - Namespace support
    37    - Allows multiple packages to have their own area in the database without
    38      worrying about conflicts
    39  - Read-only and read-write transactions with both manual and managed modes
    40  - Nested buckets
    41  - Supports registration of backend databases
    42  - Comprehensive test coverage
    43  
    44  ## Documentation
    45  
    46  [![GoDoc](https://godoc.org/github.com/btcsuite/btcwallet/walletdb?status.png)]
    47  (http://godoc.org/github.com/btcsuite/btcwallet/walletdb)
    48  
    49  Full `go doc` style documentation for the project can be viewed online without
    50  installing this package by using the GoDoc site here:
    51  http://godoc.org/github.com/btcsuite/btcwallet/walletdb
    52  
    53  You can also view the documentation locally once the package is installed with
    54  the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
    55  http://localhost:6060/pkg/github.com/btcsuite/btcwallet/walletdb
    56  
    57  ## Installation
    58  
    59  ```bash
    60  $ go get github.com/btcsuite/btcwallet/walletdb
    61  ```
    62  
    63  ## Examples
    64  
    65  * [Basic Usage Example]
    66    (http://godoc.org/github.com/btcsuite/btcwallet/walletdb#example-package--BasicUsage)  
    67    Demonstrates creating a new database, getting a namespace from it, and using a
    68    managed read-write transaction against the namespace to store and retrieve
    69    data.
    70  
    71  
    72  ## License
    73  
    74  Package walletdb is licensed under the [copyfree](http://copyfree.org) ISC
    75  License.