sync

package
v1.25.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0, MIT Imports: 9 Imported by: 4

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