bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Description

Synopsis

# Documentation

A file and a position within the file, pointing to the magic bytes of a block

Constructors

 BlockLocation Fields

Instances

 Source # Methods Source # Methods Source # MethodsshowList :: [BlockLocation] -> ShowS #

# where to find the blocks

Guess where the blocks are on the harddisk (as downloaded by the Satoshi client)

Given the directory containing the blocks (blk000xx.dat), we return the list of the block files (full paths)

For example on windows the directory is

C:/Users/<username>/Application Data/Bitcoin/blocks/

The argument is the block directory

Lazily loads all blocks. Note 1: all blocks won't fit the memory, so you must process this lazy stream immediately and let the GC free the old blocks.

Note 2: this will also load the out-of-longest-chain blocks

This version also returns the block file and the position within the file

The argument is the block directory

Tries to load a block from a file at the given position