sync

package
v0.0.0-...-477d63b Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckBlockStoreBlocks = false
View Source
var CursorHeight = metrics.Must1LabelInteger("midgard_chain_cursor_height", "node")

CursorHeight is the Tendermint chain position [sequence identifier].

View Source
var NodeHeight = metrics.Must1LabelRealSample("midgard_chain_height", "node")

NodeHeight is the latest Tendermint chain position [sequence identifier] reported by the node.

Functions

func InitBlockFetch

func InitBlockFetch(ctx context.Context) (<-chan chain.Block, jobs.NamedFunction)

func InitGlobalSync

func InitGlobalSync(ctx context.Context)

func SetFirstBlock

func SetFirstBlock(height int64, timestmap db.Nano, hash string)

Types

type Iterator

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

func NewIterator

func NewIterator(s *Sync, startHeight, finalHeight int64) Iterator

func (*Iterator) FetchingFrom

func (i *Iterator) FetchingFrom() string

func (*Iterator) Next

func (i *Iterator) Next() (*chain.Block, error)

type Sync

type Sync struct {
	// contains filtered or unexported fields
}
var GlobalSync *Sync

func (*Sync) BlockStoreHeight

func (s *Sync) BlockStoreHeight() int64

func (*Sync) CatchUp

func (s *Sync) CatchUp(out chan<- chain.Block, startHeight int64) (
	height int64, inSync bool, err error)

CatchUp reads the latest block height from Status then it fetches all blocks from offset to that height. The error return is never nil. See ErrQuit and ErrNoData for normal exit.

func (*Sync) CheckGenesisStatus

func (s *Sync) CheckGenesisStatus()

func (*Sync) FetchSingle

func (s *Sync) FetchSingle(height int64) (*coretypes.ResultBlockResults, error)

func (*Sync) KeepInSync

func (s *Sync) KeepInSync(ctx context.Context, out chan chain.Block)

Directories

Path Synopsis
Package chain provides a blockchain client.
Package chain provides a blockchain client.

Jump to

Keyboard shortcuts

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