ingest

package
v21.0.0-a-rc3-testnet Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

Ingest

This is a package that is responsible for ingesting end-of-block data into various sinks. It is designed to be extensible. A user can add a new sink by implementing an Ingester interface and then calling RegisterIngester in app.go.

Note that to avoid causing a chain halt, any error or panic occuring during ingestion is logged and silently ignored.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IngestManager

type IngestManager interface {
	// RegisterIngester registers an ingester.
	RegisterIngester(ingester Ingester)
	// ProcessBlock processes the block and ingests data into various sinks.
	// Must never panic. If panic occurs, it is silently logged and ignored.
	// If the ingester returns an error, it is silently logged and ignored.
	ProcessBlock(ctx sdk.Context)
}

IngestManager is an interface that defines the methods for the ingest manager. Ingest manager handles the processing of blocks and ingesting data into various sinks tha are defined by the Ingester interface.

func NewIngestManager

func NewIngestManager() IngestManager

NewIngestManager creates a new IngestManager.

type Ingester

type Ingester interface {
	// ProcessBlock processes the block and ingests data into a sink.
	// Returns error if the ingester fails to ingest data.
	ProcessBlock(ctx sdk.Context) error

	GetName() string
}

Ingester is an interface that defines the methods for the ingester. Ingester ingests data into a sink.

Jump to

Keyboard shortcuts

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