process

package
v0.0.0-...-716ec33 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDataProcessor

func NewDataProcessor(
	blockHandler BlockHandler,
	transactionHandler TransactionHandler,
	scHandler SCResultsHandler,
	receiptHandler ReceiptHandler,
	logHandler LogHandler,
	accountsHandler AccountsHandler,
) (*dataProcessor, error)

NewDataProcessor creates a new instance of data processor, which handles all sub-processes

Types

type AccountsHandler

type AccountsHandler interface {
	ProcessAccounts(
		processedTxs []*schema.Transaction,
		processedSCRs []*schema.SCResult,
		processedReceipts []*schema.Receipt) []*schema.AccountBalanceUpdate
}

AccountsHandler defines what an account processor shall do

type BlockHandler

type BlockHandler interface {
	ProcessBlock(args *indexer.ArgsSaveBlockData) (*schema.Block, error)
}

BlockHandler defines what a block processor shall do

type LogHandler

type LogHandler interface {
	ProcessLogs(logs []*data.LogData) []*schema.Log
}

LogHandler defines what a log processor shall do

type MiniBlockHandler

type MiniBlockHandler interface {
	ProcessMiniBlocks(header data.HeaderHandler, body data.BodyHandler) ([]*schema.MiniBlock, error)
}

MiniBlockHandler defines what a mini blocks processor shall do

type ReceiptHandler

type ReceiptHandler interface {
	ProcessReceipts(receipts map[string]data.TransactionHandler, timeStamp uint64) []*schema.Receipt
}

ReceiptHandler defines what a receipt processor shall do

type SCResultsHandler

type SCResultsHandler interface {
	ProcessSCRs(transactions map[string]data.TransactionHandler, timeStamp uint64) []*schema.SCResult
}

SCResultsHandler defines what a smart contract processor shall do

type ShardCoordinator

type ShardCoordinator interface {
	SelfId() uint32
	ComputeId(address []byte) uint32
	IsInterfaceNil() bool
}

ShardCoordinator defines what a shard coordinator shall do

type TransactionHandler

type TransactionHandler interface {
	ProcessTransactions(
		header data.HeaderHandler,
		headerHash []byte,
		bodyHandler data.BodyHandler,
		pool *indexer.Pool) ([]*schema.Transaction, error)
}

TransactionHandler defines what a transaction processor shall do

type WSConn

type WSConn interface {
	io.Closer
	ReadMessage() (messageType int, p []byte, err error)
	WriteMessage(messageType int, data []byte) error
}

WSConn defines what a websocket shall do

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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