workItems

package
v1.1.28-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBodyTypeAssertion = errors.New("elasticsearch - body type assertion failed")

ErrBodyTypeAssertion signals that body type assertion failed

Functions

func ComputeSizeOfTxs

func ComputeSizeOfTxs(marshalizer marshal.Marshalizer, txs map[string]data.TransactionHandler) int

ComputeSizeOfTxs will compute size of transactions in bytes

Types

type RoundInfo

type RoundInfo struct {
	Index            uint64        `json:"round"`
	SignersIndexes   []uint64      `json:"signersIndexes"`
	BlockWasProposed bool          `json:"blockWasProposed"`
	ShardId          uint32        `json:"shardId"`
	Timestamp        time.Duration `json:"timestamp"`
}

RoundInfo is a structure containing block signers and shard id

type ValidatorRatingInfo

type ValidatorRatingInfo struct {
	PublicKey string  `json:"publicKey"`
	Rating    float32 `json:"rating"`
}

ValidatorRatingInfo is a structure containing validator rating information

type WorkItemHandler

type WorkItemHandler interface {
	Save() error
	IsInterfaceNil() bool
}

WorkItemHandler defines the interface for item that needs to be saved in elasticsearch database

func NewItemAccounts

func NewItemAccounts(
	indexer saveAccountsIndexer,
	accounts []state.UserAccountHandler,
) WorkItemHandler

NewItemAccounts will create a new instance of itemAccounts

func NewItemBlock

func NewItemBlock(
	indexer saveBlockIndexer,
	marshalizer marshal.Marshalizer,
	bodyHandler data.BodyHandler,
	headerHandler data.HeaderHandler,
	txPool map[string]data.TransactionHandler,
	signersIndexes []uint64,
	notarizedHeadersHashes []string,
	headerHash []byte,
) WorkItemHandler

NewItemBlock will create a new instance of ItemBlock

func NewItemRating

func NewItemRating(indexer saveRatingIndexer, indexID string, infoRating []ValidatorRatingInfo) WorkItemHandler

NewItemRating will create a new instance of itemRating

func NewItemRemoveBlock

func NewItemRemoveBlock(
	indexer removeIndexer,
	bodyHandler data.BodyHandler,
	headerHandler data.HeaderHandler,
) WorkItemHandler

NewItemRemoveBlock will create a new instance of itemRemoveBlock

func NewItemRounds

func NewItemRounds(indexer saveRounds, roundsInfo []RoundInfo) WorkItemHandler

NewItemRounds will create a new instance of itemRounds

func NewItemTpsBenchmark

func NewItemTpsBenchmark(indexer saveTpsBenchmark, tpsBenchmark statistics.TPSBenchmark) WorkItemHandler

NewItemTpsBenchmark will create a new instance of itemTpsBenchmark

func NewItemValidators

func NewItemValidators(
	indexer saveValidatorsIndexer,
	epoch uint32,
	validatorsPubKeys map[uint32][][]byte,
) WorkItemHandler

NewItemValidators will create a new instance of itemValidators

Jump to

Keyboard shortcuts

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