rep

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	// raw
	PublishRawBlock(ctx context.Context, b interface{}) error
	PublishRawTransaction(ctx context.Context, tx interface{}) error
	PublishRawBlockResults(ctx context.Context, br interface{}) error
	PublishRawGenesis(ctx context.Context, g interface{}) error
}

type GrpcClient

type GrpcClient interface {
	Block(ctx context.Context, height int64) (*cometbftcoretypes.ResultBlock, error)
	Validators(ctx context.Context, height int64) (*cometbftcoretypes.ResultValidators, error)

	Txs(ctx context.Context, height int64, txs cometbfttypes.Txs) ([]*tx.GetTxResponse, error)
}

type Lifecycle

type Lifecycle interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Lifecycle indicates that struct can be run as an application component

type RPCClient

type RPCClient interface {
	SubscribeNewBlocks(ctx context.Context) (<-chan cometbftcoretypes.ResultEvent, error)
	Genesis(ctx context.Context) (*cometbfttypes.GenesisDoc, error)
	GetLastBlockHeight(ctx context.Context) (int64, error)
	GetBlockEvents(ctx context.Context, height int64) (begin, end types.BlockerEvents, err error)
}

type Storage

type Storage interface {
	GetBlockByHeight(ctx context.Context, height int64) (*model.Block, error)
	CreateBlock(ctx context.Context, block *model.Block) error
	SetProcessedStatus(ctx context.Context, height int64) error
	SetErrorStatus(ctx context.Context, height int64, msg string) error
	UpdateStatus(ctx context.Context, height int64, status model.Status) error
	GetErrorBlockHeights(ctx context.Context) ([]int64, error)

	InsertErrorTx(ctx context.Context, message model.Tx) error
	InsertErrorMessage(ctx context.Context, message model.Message) error

	Ping(ctx context.Context) error
}

Storage implementation needed for store some tmp data for correct processing

Jump to

Keyboard shortcuts

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