broadcast

package
v1.1.66 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDelayBroadcastDataForLeader

func CreateDelayBroadcastDataForLeader(
	headerHash []byte,
	miniblocks map[uint32][]byte,
	transactions map[string][][]byte,
) *delayedBroadcastData

CreateDelayBroadcastDataForLeader -

func CreateDelayBroadcastDataForValidator

func CreateDelayBroadcastDataForValidator(
	headerHash []byte,
	header data.HeaderHandler,
	miniblocksData map[uint32][]byte,
	miniBlockHashes map[string]map[string]struct{},
	transactionsData map[string][][]byte,
	order uint32,
) *delayedBroadcastData

CreateDelayBroadcastDataForValidator creates the delayed broadcast data

func CreateValidatorHeaderBroadcastData

func CreateValidatorHeaderBroadcastData(
	headerHash []byte,
	header data.HeaderHandler,
	metaMiniBlocksData map[uint32][]byte,
	metaTransactionsData map[string][][]byte,
	order uint32,
) *validatorHeaderBroadcastData

CreateValidatorHeaderBroadcastData creates a validatorHeaderBroadcastData object from the given parameters

func NewCommonMessenger

func NewCommonMessenger(
	marshalizer marshal.Marshalizer,
	messenger consensus.P2PMessenger,
	privateKey crypto.PrivateKey,
	shardCoordinator sharding.Coordinator,
	peerSigHandler crypto.PeerSignatureHandler,
) (*commonMessenger, error)

NewCommonMessenger will return a new instance of a commonMessenger

func NewDelayedBlockBroadcaster

func NewDelayedBlockBroadcaster(args *ArgsDelayedBlockBroadcaster) (*delayedBlockBroadcaster, error)

NewDelayedBlockBroadcaster create a new instance of a delayed block data broadcaster

func NewMetaChainMessenger

func NewMetaChainMessenger(
	args MetaChainMessengerArgs,
) (*metaChainMessenger, error)

NewMetaChainMessenger creates a new metaChainMessenger object

func NewShardChainMessenger

func NewShardChainMessenger(
	args ShardChainMessengerArgs,
) (*shardChainMessenger, error)

NewShardChainMessenger creates a new shardChainMessenger object

func ValidatorDelayPerOrder

func ValidatorDelayPerOrder() time.Duration

ValidatorDelayPerOrder -

Types

type ArgsDelayedBlockBroadcaster

type ArgsDelayedBlockBroadcaster struct {
	InterceptorsContainer process.InterceptorsContainer
	HeadersSubscriber     consensus.HeadersPoolSubscriber
	ShardCoordinator      sharding.Coordinator
	LeaderCacheSize       uint32
	ValidatorCacheSize    uint32
}

ArgsDelayedBlockBroadcaster holds the arguments to create a delayed block broadcaster

type CommonMessengerArgs

type CommonMessengerArgs struct {
	Marshalizer                marshal.Marshalizer
	Hasher                     hashing.Hasher
	Messenger                  consensus.P2PMessenger
	PrivateKey                 crypto.PrivateKey
	ShardCoordinator           sharding.Coordinator
	PeerSignatureHandler       crypto.PeerSignatureHandler
	HeadersSubscriber          consensus.HeadersPoolSubscriber
	InterceptorsContainer      process.InterceptorsContainer
	MaxDelayCacheSize          uint32
	MaxValidatorDelayCacheSize uint32
}

CommonMessengerArgs holds the arguments for creating commonMessenger instance

type HeaderDataForValidator

type HeaderDataForValidator struct {
	Round        uint64
	PrevRandSeed []byte
}

HeaderDataForValidator -

func GetShardDataFromMetaChainBlock

func GetShardDataFromMetaChainBlock(
	headerHandler data.HeaderHandler,
	shardID uint32,
) ([][]byte, []*HeaderDataForValidator, error)

GetShardDataFromMetaChainBlock -

type MetaChainMessengerArgs

type MetaChainMessengerArgs struct {
	CommonMessengerArgs
}

MetaChainMessengerArgs holds the arguments for creating a metaChainMessenger instance

type ShardChainMessengerArgs

type ShardChainMessengerArgs struct {
	CommonMessengerArgs
}

ShardChainMessengerArgs holds the arguments for creating a shardChainMessenger instance

Jump to

Keyboard shortcuts

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