tipset

package
v0.11.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func (*Builder) Build

func (b *Builder) Build() (Indexer, error)

func (*Builder) Name

func (b *Builder) Name() string

func (*Builder) WithTasks

func (b *Builder) WithTasks(tasks []string) IndexerBuilder

type Indexer

type Indexer interface {
	TipSet(ctx context.Context, ts *types.TipSet) (chan *Result, chan error, error)
}

type IndexerBuilder

type IndexerBuilder interface {
	WithTasks(tasks []string) IndexerBuilder
	Build() (Indexer, error)
	Name() string
}

func NewBuilder

func NewBuilder(node tasks.DataSource, name string) IndexerBuilder

type Result

type Result struct {
	// Name of the task executed.
	Name string
	// Data extracted during task execution.
	Data model.Persistable
	// Report containing details of task execution success and duration.
	Report visormodel.ProcessingReportList
}

type TipSetIndexer

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

TipSetIndexer extracts block, message and actor state data from a tipset and persists it to storage. Extraction and persistence are concurrent. Extraction of the a tipset can proceed while data from the previous extraction is being persisted. The indexer may be given a time window in which to complete data extraction. The name of the indexer is used as the reporter in the visor_processing_reports table.

func (*TipSetIndexer) TipSet

func (ti *TipSetIndexer) TipSet(ctx context.Context, ts *types.TipSet) (chan *Result, chan error, error)

TipSet keeps no internal state and asynchronously indexes `ts` returning Result's as they extracted. If the TipSetIndexer encounters an error (fails to fetch ts's parent) it returns immediately and performs no work. If one of the TipSetIndexer's tasks encounters a fatal error, the error is return on the error channel.

Jump to

Keyboard shortcuts

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