sender

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalSender

type ExternalSender interface {
	GetAcceptedFrontier(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32)
	AcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)

	GetAccepted(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerIDs ids.Set)
	Accepted(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)

	Get(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)
	Put(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)

	PushQuery(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)
	PullQuery(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerID ids.ID)
	Chits(validatorID ids.ShortID, chainID ids.ID, requestID uint32, votes ids.Set)
}

ExternalSender sends consensus messages to other validators Right now this is implemented in the networking package

type ExternalSenderTest

type ExternalSenderTest struct {
	T *testing.T
	B *testing.B

	CantGetAcceptedFrontier, CantAcceptedFrontier,
	CantGetAccepted, CantAccepted,
	CantGet, CantPut,
	CantPullQuery, CantPushQuery, CantChits bool

	GetAcceptedFrontierF func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32)
	AcceptedFrontierF    func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)
	GetAcceptedF         func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerIDs ids.Set)
	AcceptedF            func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)
	GetF                 func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)
	PutF                 func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)
	PushQueryF           func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)
	PullQueryF           func(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerID ids.ID)
	ChitsF               func(validatorID ids.ShortID, chainID ids.ID, requestID uint32, votes ids.Set)
}

ExternalSenderTest is a test sender

func (*ExternalSenderTest) Accepted

func (s *ExternalSenderTest) Accepted(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)

Accepted calls AcceptedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) AcceptedFrontier

func (s *ExternalSenderTest) AcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)

AcceptedFrontier calls AcceptedFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Chits

func (s *ExternalSenderTest) Chits(vdr ids.ShortID, chainID ids.ID, requestID uint32, votes ids.Set)

Chits calls ChitsF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Default

func (s *ExternalSenderTest) Default(cant bool)

Default set the default callable value to [cant]

func (*ExternalSenderTest) Get

func (s *ExternalSenderTest) Get(vdr ids.ShortID, chainID ids.ID, requestID uint32, vtxID ids.ID)

Get calls GetF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) GetAccepted

func (s *ExternalSenderTest) GetAccepted(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32, containerIDs ids.Set)

GetAccepted calls GetAcceptedF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) GetAcceptedFrontier

func (s *ExternalSenderTest) GetAcceptedFrontier(validatorIDs ids.ShortSet, chainID ids.ID, requestID uint32)

GetAcceptedFrontier calls GetAcceptedFrontierF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) PullQuery

func (s *ExternalSenderTest) PullQuery(vdrs ids.ShortSet, chainID ids.ID, requestID uint32, vtxID ids.ID)

PullQuery calls PullQueryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) PushQuery

func (s *ExternalSenderTest) PushQuery(vdrs ids.ShortSet, chainID ids.ID, requestID uint32, vtxID ids.ID, vtx []byte)

PushQuery calls PushQueryF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

func (*ExternalSenderTest) Put

func (s *ExternalSenderTest) Put(vdr ids.ShortID, chainID ids.ID, requestID uint32, vtxID ids.ID, vtx []byte)

Put calls PutF if it was initialized. If it wasn't initialized and this function shouldn't be called and testing was initialized, then testing will fail.

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender sends consensus messages to other validators

func (*Sender) Accepted

func (s *Sender) Accepted(validatorID ids.ShortID, requestID uint32, containerIDs ids.Set)

Accepted ...

func (*Sender) AcceptedFrontier

func (s *Sender) AcceptedFrontier(validatorID ids.ShortID, requestID uint32, containerIDs ids.Set)

AcceptedFrontier ...

func (*Sender) Chits

func (s *Sender) Chits(validatorID ids.ShortID, requestID uint32, votes ids.Set)

Chits sends chits

func (*Sender) Context

func (s *Sender) Context() *snow.Context

Context of this sender

func (*Sender) Get

func (s *Sender) Get(validatorID ids.ShortID, requestID uint32, containerID ids.ID)

Get sends a Get message to the consensus engine running on the specified chain to the specified validator. The Get message signifies that this consensus engine would like the recipient to send this consensus engine the specified container.

func (*Sender) GetAccepted

func (s *Sender) GetAccepted(validatorIDs ids.ShortSet, requestID uint32, containerIDs ids.Set)

GetAccepted ...

func (*Sender) GetAcceptedFrontier

func (s *Sender) GetAcceptedFrontier(validatorIDs ids.ShortSet, requestID uint32)

GetAcceptedFrontier ...

func (*Sender) Initialize

func (s *Sender) Initialize(ctx *snow.Context, sender ExternalSender, router router.Router, timeouts *timeout.Manager)

Initialize this sender

func (*Sender) PullQuery

func (s *Sender) PullQuery(validatorIDs ids.ShortSet, requestID uint32, containerID ids.ID)

PullQuery sends a PullQuery message to the consensus engines running on the specified chains on the specified validators. The PullQuery message signifies that this consensus engine would like each validator to send their preferred frontier.

func (*Sender) PushQuery

func (s *Sender) PushQuery(validatorIDs ids.ShortSet, requestID uint32, containerID ids.ID, container []byte)

PushQuery sends a PushQuery message to the consensus engines running on the specified chains on the specified validators. The PushQuery message signifies that this consensus engine would like each validator to send their preferred frontier given the existence of the specified container.

func (*Sender) Put

func (s *Sender) Put(validatorID ids.ShortID, requestID uint32, containerID ids.ID, container []byte)

Put sends a Put message to the consensus engine running on the specified chain on the specified validator. The Put message signifies that this consensus engine is giving to the recipient the contents of the specified container.

Jump to

Keyboard shortcuts

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