Commit graph

11 commits

Author SHA1 Message Date
Dave Collins
329c0bf094 Update overview documentation to more recent stats. 2014-07-08 08:54:55 -05:00
Dave Collins
9ed908f44a Use testable example and update README.md.
This commit moves the example to a test file so it integrates nicely with
Go's example tooling.

This allows the example output to be tested as a part of running the
normal Go tests to help ensure it doesn't get out of date with the code.
It is also nice to have the example in one place rather than repeating it
in doc.go and README.md.

Links and information about the example have been included in README.md in
place of the example.
2014-07-08 08:47:18 -05:00
Dave Collins
75e199ece8 Use btcnet genesis params for examples and tests. 2014-05-28 01:29:51 -05:00
Dave Collins
6b18796af7 Add 2014 to copyright dates. 2014-01-08 23:54:52 -06:00
Dave Collins
5eee027f92 Correct leveldb package documenation.
The leveldb package documentation still referred to sqlite from
original copy/paste.
2013-10-22 15:26:44 -05:00
Dave Collins
8062889d04 Update for latest btcutil and btcwire changes.
This commit updates the calls into btcutil and btcwire for the latest API
changes which remove the need for the protocol version for serialization
and deserialization of blocks and transactions.
2013-08-05 18:28:17 -05:00
Dave Collins
dc3a2dbac0 Correct example usage.
The variable to insert is 'genesis', not 'block'.
2013-07-29 12:41:30 -05:00
Dave Collins
25684a2ccb Don't add a genesis block by default.
This commit modifies the way initial database creation is handled.

Previously, the genesis for the main chain was inserted automatically upon
creation of the database.  However, that approach caused an issue since
other networks such as the test network don't use the same genesis block
as the main network.

The new approach introduced by this commit is to leave it up to the caller
to insert the desired genesis block.  In order to support this, the
InsertBlock function has been modified to allow the first (and only the
first) block to be inserted without having an existing parent.  Also, the
NewestSha function has been modified to return a zero hash, -1 for the
height, and no error when the database does not yet have any blocks.  This
allows the caller to determine the difference between no blocks and only
the genesis block (in which case the return values would be the genesis
hash and 0 for the height).
2013-07-29 11:48:10 -05:00
Steven Roose
2c0dc2d862 Small errors in documentation.
I could not resist while reading.
2013-06-01 00:09:26 +02:00
Dave Collins
b686bbacf5 Update and fix usage example.
This commit updates the usage example as follows:

- Add a defer db.Close since the database should be closed after the
  caller is done with it
- Correct the import path for the btcdb/sqlite3 package
- Add a db extension to the example database name
- Make the error handling and comments match the standard style
2013-05-31 13:57:18 -05:00
Dave Collins
752ca5dfbb Initial implementation. 2013-05-29 10:09:26 -05:00