index

package
v1.26.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CoalesceMinDelay      = time.Second
	CoalesceMaxDelay      = 15 * time.Second
	CoalesceMergeInterval = time.Second
)

coalescer configuration (TODO: use observer instead) these are exposed to make tests snappy

View Source
var ErrClosed = errors.New("index closed")
View Source
var ErrNotFound = errors.New("message not found")

Functions

func PopulateAfterSnapshot

func PopulateAfterSnapshot(lctx context.Context, basePath string, cs ChainStore) error

Types

type ChainStore

type ChainStore interface {
	SubscribeHeadChanges(f store.ReorgNotifee)
	MessagesForTipset(ctx context.Context, ts *types.TipSet) ([]types.ChainMsg, error)
	GetHeaviestTipSet() *types.TipSet
	GetTipSetFromKey(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
}

chain store interface; we could use store.ChainStore directly, but this simplifies unit testing.

type MsgIndex

type MsgIndex interface {
	// GetMsgInfo retrieves the message metadata through the index.
	// The lookup is done using the onchain message Cid; that is the signed message Cid
	// for SECP messages and unsigned message Cid for BLS messages.
	GetMsgInfo(ctx context.Context, m cid.Cid) (MsgInfo, error)
	// Close closes the index
	Close() error
}

MsgIndex is the interface to the message index

var DummyMsgIndex MsgIndex = dummyMsgIndex{}

func NewMsgIndex

func NewMsgIndex(lctx context.Context, basePath string, cs ChainStore) (MsgIndex, error)

type MsgInfo

type MsgInfo struct {
	// the message this record refers to
	Message cid.Cid
	// the tipset where this message was included
	TipSet cid.Cid
	// the epoch where this message was included
	Epoch abi.ChainEpoch
}

MsgInfo is the Message metadata the index tracks.

Jump to

Keyboard shortcuts

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