Correct leveldb package documenation.
The leveldb package documentation still referred to sqlite from original copy/paste.
This commit is contained in:
parent
3b56ccaff7
commit
5eee027f92
2 changed files with 6 additions and 16 deletions
10
doc.go
10
doc.go
|
@ -9,8 +9,7 @@ As of May 2013, there are over 235,000 blocks in the Bitcoin block chain and
|
||||||
and over 17 million transactions (which turns out to be over 11GB of data).
|
and over 17 million transactions (which turns out to be over 11GB of data).
|
||||||
btcdb provides a database layer to store and retrieve this data in a fairly
|
btcdb 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
|
simple and efficient manner. The use of this should not require specific
|
||||||
knowledge of the database backend used although currently only db_sqlite is
|
knowledge of the database backend.
|
||||||
provided.
|
|
||||||
|
|
||||||
Basic Design
|
Basic Design
|
||||||
|
|
||||||
|
@ -20,8 +19,7 @@ increases monotonically. Each transaction belongs to a single block
|
||||||
although a block can have a variable number of transactions. Along
|
although a block can have a variable number of transactions. Along
|
||||||
with these two items, several convenience functions for dealing with
|
with these two items, several convenience functions for dealing with
|
||||||
the database are provided as well as functions to query specific items
|
the database are provided as well as functions to query specific items
|
||||||
that may be present in a block or tx (although many of these are in
|
that may be present in a block or tx.
|
||||||
the sqlite3 subpackage).
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
|
|
||||||
|
@ -34,14 +32,14 @@ referenced parent block to already exist. In a more concrete example:
|
||||||
// Import packages.
|
// Import packages.
|
||||||
import (
|
import (
|
||||||
"github.com/conformal/btcdb"
|
"github.com/conformal/btcdb"
|
||||||
_ "github.com/conformal/btcdb/sqlite3"
|
_ "github.com/conformal/btcdb/ldb"
|
||||||
"github.com/conformal/btcutil"
|
"github.com/conformal/btcutil"
|
||||||
"github.com/conformal/btcwire"
|
"github.com/conformal/btcwire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create a database and schedule it to be closed on exit.
|
// Create a database and schedule it to be closed on exit.
|
||||||
dbName := "example.db"
|
dbName := "example.db"
|
||||||
db, err := btcdb.CreateDB("sqlite", dbName)
|
db, err := btcdb.CreateDB("leveldb", dbName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Log and handle the error
|
// Log and handle the error
|
||||||
}
|
}
|
||||||
|
|
12
ldb/doc.go
12
ldb/doc.go
|
@ -3,20 +3,12 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package sqlite3 implements a sqlite3 instance of btcdb.
|
Package ldb implements a instance of btcdb backed by leveldb.
|
||||||
|
|
||||||
sqlite provides a zero setup, single file database. It requires cgo
|
|
||||||
and the presence of the sqlite library and headers, but nothing else.
|
|
||||||
The performance is generally high although it goes down with database
|
|
||||||
size.
|
|
||||||
|
|
||||||
Many of the block or tx specific functions for btcdb are in this subpackage.
|
|
||||||
|
|
||||||
Database version number is stored in a flat file <dbname>.ver
|
Database version number is stored in a flat file <dbname>.ver
|
||||||
Currently a single (littlendian) integer in the file. If there is
|
Currently a single (littlendian) integer in the file. If there is
|
||||||
additional data to save in the future, the presense of additional
|
additional data to save in the future, the presence of additional
|
||||||
data can be indicated by changing the version number, then parsing the
|
data can be indicated by changing the version number, then parsing the
|
||||||
file differently.
|
file differently.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
package ldb
|
package ldb
|
||||||
|
|
Loading…
Reference in a new issue