plugin

package
v1.18.17 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginSelf = PluginShadow{
		ShadowName:  func(s string) string { return s },
		ShadowTable: func(a Table) Table { return a },
	}
)

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Name() string
	Version() string
	Type() Type
	Start(context.Context) error
	Stop(context.Context) error
	PutBlock(context.Context, *block.Block) error
}

type BatchAdapter added in v1.14.6

type BatchAdapter interface {
	Adapter
	PutBlocks(ctx context.Context, blks []*block.Block) error
	BatchSize() int
}

type CatchUpAdapter added in v1.18.16

type CatchUpAdapter interface {
	Adapter
	CatchUpSafe() bool
}

CatchUpAdapter is implemented by plugins that opt in to running in catch-up mode (where the index starts mid-chain at the current tip instead of from height 0).

Plugins that maintain cumulative state derived from full history — balances, holders, lifetime totals, etc. — should NOT implement this, or should return false: starting from an arbitrary height would produce permanently incorrect data. Per-block fact plugins (block metadata, receipts, action records) and snapshot-derivable plugins (state queried from chain at each height) are safe candidates.

Operators can override the safety check via iotex.catchUpAllowPlugins in config.

type DependentAdapter

type DependentAdapter interface {
	DependentPlugins() []string
}

type PluginShadow added in v1.17.32

type PluginShadow struct {
	ShadowName  func(string) string
	ShadowTable func(a Table) Table
}

type Table added in v1.17.32

type Table interface {
	TableName() string
}

type Type

type Type int
const (
	TypeStandard Type = iota
	TypeWorker        //independence worker does not implement PutBlock
)

Jump to

Keyboard shortcuts

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