adapter

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockPersistence

type BlockPersistence interface {
	WriteNextBlock(blockPair *protocol.BlockPairContainer) error

	ScanBlocks(from primitives.BlockHeight, pageSize uint8, f CursorFunc) error

	GetLastBlockHeight() (primitives.BlockHeight, error)
	GetLastBlock() (*protocol.BlockPairContainer, error)

	GetTransactionsBlock(height primitives.BlockHeight) (*protocol.TransactionsBlockContainer, error)
	GetResultsBlock(height primitives.BlockHeight) (*protocol.ResultsBlockContainer, error)
	GetBlockByTx(txHash primitives.Sha256, minBlockTs primitives.TimestampNano, maxBlockTs primitives.TimestampNano) (block *protocol.BlockPairContainer, txIndexInBlock int, err error)

	GetBlockTracker() *synchronization.BlockTracker
}

func NewFilesystemBlockPersistence added in v0.7.4

func NewFilesystemBlockPersistence(dataDir string, parent log.BasicLogger, metricFactory metric.Factory) BlockPersistence

type CursorFunc added in v0.7.4

type CursorFunc func(first primitives.BlockHeight, page []*protocol.BlockPairContainer) (wantsMore bool)

A Callback function provided by consumers of blocks from storage. Each invocation receives a single blocks page of the requested size. Methods receiving this type will call this function repeatedly until it returns false to signal no more pages are required or until there are no more blocks to fetch.

type FilesystemBlockPersistence added in v0.7.4

type FilesystemBlockPersistence struct {
	// contains filtered or unexported fields
}

func (*FilesystemBlockPersistence) GetBlockByTx added in v0.7.4

func (f *FilesystemBlockPersistence) GetBlockByTx(txHash primitives.Sha256, minBlockTs primitives.TimestampNano, maxBlockTs primitives.TimestampNano) (block *protocol.BlockPairContainer, txIndexInBlock int, err error)

func (*FilesystemBlockPersistence) GetBlockTracker added in v0.7.4

func (*FilesystemBlockPersistence) GetLastBlock added in v0.7.4

func (*FilesystemBlockPersistence) GetLastBlockHeight added in v0.7.4

func (f *FilesystemBlockPersistence) GetLastBlockHeight() (primitives.BlockHeight, error)

func (*FilesystemBlockPersistence) GetResultsBlock added in v0.7.4

func (*FilesystemBlockPersistence) GetTransactionsBlock added in v0.7.4

func (*FilesystemBlockPersistence) ScanBlocks added in v0.7.4

func (f *FilesystemBlockPersistence) ScanBlocks(from primitives.BlockHeight, pageSize uint8, cursor CursorFunc) error

func (*FilesystemBlockPersistence) WriteNextBlock added in v0.7.4

func (f *FilesystemBlockPersistence) WriteNextBlock(blockPair *protocol.BlockPairContainer) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL