Documentation ¶
Index ¶
- func GobLineToBlock(line []byte) (*chain.Block, error)
- func NewChunk(name string) (*chunk, error)
- type BlockStore
- func (b *BlockStore) Close()
- func (b *BlockStore) DumpBlock(block *chain.Block, forceFinalizeChunk bool)
- func (b *BlockStore) FistFetchedHeight() (int64, error)
- func (b *BlockStore) HasHeight(height int64) bool
- func (b *BlockStore) Iterator(startHeight int64) Iterator
- func (b *BlockStore) LastFetchedHeight() int64
- func (b *BlockStore) SingleBlock(height int64) (*chain.Block, error)
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockStore ¶
type BlockStore struct {
// contains filtered or unexported fields
}
func NewBlockStore ¶
func NewBlockStore(ctx context.Context, cfg config.BlockStore, chainId string) *BlockStore
If chainId != "" then blocks until missing chunks are downloaded from remote repository to local folder. During the download the hashes of the remote chunks are checked.
TODO(freki): Make sure that public functions return sane results for null. TODO(freki): Log if blockstore is created or not and what the latest height there is. TODO(freki): Read acceptable hash values for this specific chainId
func (*BlockStore) Close ¶
func (b *BlockStore) Close()
func (*BlockStore) DumpBlock ¶
func (b *BlockStore) DumpBlock(block *chain.Block, forceFinalizeChunk bool)
func (*BlockStore) FistFetchedHeight ¶
func (b *BlockStore) FistFetchedHeight() (int64, error)
func (*BlockStore) HasHeight ¶
func (b *BlockStore) HasHeight(height int64) bool
func (*BlockStore) Iterator ¶
func (b *BlockStore) Iterator(startHeight int64) Iterator
func (*BlockStore) LastFetchedHeight ¶
func (b *BlockStore) LastFetchedHeight() int64
func (*BlockStore) SingleBlock ¶
func (b *BlockStore) SingleBlock(height int64) (*chain.Block, error)
Click to show internal directories.
Click to hide internal directories.