adapter

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 4 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) (bool, primitives.BlockHeight, error)
	ScanBlocks(from primitives.BlockHeight, pageSize uint8, f CursorFunc) error
	GetLastBlockHeight() (primitives.BlockHeight, error)
	GetLastBlock() (*protocol.BlockPairContainer, error)
	GetBlock(height primitives.BlockHeight) (*protocol.BlockPairContainer, error)
	GetSyncState() internodesync.SyncState
	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
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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