d574a3af6d
This commit contains the entire btcdb repository along with several changes needed to move all of the files into the database directory in order to prepare it for merging. This does NOT update btcd or any of the other packages to use the new location as that will be done separately. - All import paths in the old btcdb test files have been changed to the new location - All references to btcdb as the package name have been chagned to database - The coveralls badge has been removed since it unfortunately doesn't support coverage of sub-packages This is ongoing work toward #214.
31 lines
1.4 KiB
Go
31 lines
1.4 KiB
Go
// Copyright (c) 2013-2014 Conformal Systems LLC.
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
/*
|
|
Package database provides a database interface for the Bitcoin block chain.
|
|
|
|
As of July 2014, there are over 309,000 blocks in the Bitcoin block chain and
|
|
and over 42 million transactions (which turns out to be over 21GB of data).
|
|
This package provides a database layer to store and retrieve this data in a
|
|
fairly simple and efficient manner. The use of this should not require specific
|
|
knowledge of the database backend.
|
|
|
|
Basic Design
|
|
|
|
The basic design of this package is to provide two classes of items in a
|
|
database; blocks and transactions (tx) where the block number increases
|
|
monotonically. Each transaction belongs to a single block although a block can
|
|
have a variable number of transactions. Along with these two items, several
|
|
convenience functions for dealing with the database are provided as well as
|
|
functions to query specific items that may be present in a block or tx.
|
|
|
|
Usage
|
|
|
|
At the highest level, the use of this packages just requires that you import it,
|
|
setup a database, insert some data into it, and optionally, query the data back.
|
|
The first block inserted into the database will be treated as the genesis block.
|
|
Every subsequent block insert requires the referenced parent block to already
|
|
exist.
|
|
*/
|
|
package database
|