Documentation ¶
Index ¶
- type BlockPersistence
- type CursorFunc
- type FilesystemBlockPersistence
- func (f *FilesystemBlockPersistence) GetBlockByTx(txHash primitives.Sha256, minBlockTs primitives.TimestampNano, ...) (block *protocol.BlockPairContainer, txIndexInBlock int, err error)
- func (f *FilesystemBlockPersistence) GetBlockTracker() *synchronization.BlockTracker
- func (f *FilesystemBlockPersistence) GetLastBlock() (*protocol.BlockPairContainer, error)
- func (f *FilesystemBlockPersistence) GetLastBlockHeight() (primitives.BlockHeight, error)
- func (f *FilesystemBlockPersistence) GetResultsBlock(height primitives.BlockHeight) (*protocol.ResultsBlockContainer, error)
- func (f *FilesystemBlockPersistence) GetTransactionsBlock(height primitives.BlockHeight) (*protocol.TransactionsBlockContainer, error)
- func (f *FilesystemBlockPersistence) ScanBlocks(from primitives.BlockHeight, pageSize uint8, cursor CursorFunc) error
- func (f *FilesystemBlockPersistence) WriteNextBlock(blockPair *protocol.BlockPairContainer) error
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 (f *FilesystemBlockPersistence) GetBlockTracker() *synchronization.BlockTracker
func (*FilesystemBlockPersistence) GetLastBlock ¶ added in v0.7.4
func (f *FilesystemBlockPersistence) GetLastBlock() (*protocol.BlockPairContainer, error)
func (*FilesystemBlockPersistence) GetLastBlockHeight ¶ added in v0.7.4
func (f *FilesystemBlockPersistence) GetLastBlockHeight() (primitives.BlockHeight, error)
func (*FilesystemBlockPersistence) GetResultsBlock ¶ added in v0.7.4
func (f *FilesystemBlockPersistence) GetResultsBlock(height primitives.BlockHeight) (*protocol.ResultsBlockContainer, error)
func (*FilesystemBlockPersistence) GetTransactionsBlock ¶ added in v0.7.4
func (f *FilesystemBlockPersistence) GetTransactionsBlock(height primitives.BlockHeight) (*protocol.TransactionsBlockContainer, error)
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
Click to show internal directories.
Click to hide internal directories.