sync

package
v0.0.0-...-2701d8d Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferedTipsetChannel

func BufferedTipsetChannel(ctx context.Context, api BufferedTipsetChannelApi, lastHeight abi.ChainEpoch, size int) (<-chan *types.TipSet, error)

BufferedTipsetChannel returns an unbuffered channel of tipsets. Buffering occurs internally to handle revert ChainNotify changes. The returned channel can output tipsets at the same height twice if a reorg larger the the provided `size` occurs.

func SyncWait

func SyncWait(ctx context.Context, napi SyncWaitApi) error

SyncWait returns when ChainHead is within 20 epochs of the expected height

Types

type BufferedTipsetChannelApi

type BufferedTipsetChannelApi interface {
	ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
	Version(context.Context) (api.APIVersion, error)
	ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error)
}

type SyncWaitApi

type SyncWaitApi interface {
	SyncState(context.Context) (*api.SyncState, error)
	ChainHead(context.Context) (*types.TipSet, error)
}

Jump to

Keyboard shortcuts

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