router

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 ChainRouter

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

ChainRouter routes incoming messages from the validator network to the consensus engines that the messages are intended for. Note that consensus engines are uniquely identified by the ID of the chain that they are working on.

func (*ChainRouter) Accepted

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

Accepted routes an incoming Accepted request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) AcceptedFrontier

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

AcceptedFrontier routes an incoming AcceptedFrontier request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) AddChain

func (sr *ChainRouter) AddChain(chain *handler.Handler)

AddChain registers the specified chain so that incoming messages can be routed to it

func (*ChainRouter) Chits

func (sr *ChainRouter) Chits(validatorID ids.ShortID, chainID ids.ID, requestID uint32, votes ids.Set)

Chits routes an incoming Chits message from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) Get

func (sr *ChainRouter) Get(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)

Get routes an incoming Get request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) GetAccepted

func (sr *ChainRouter) GetAccepted(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)

GetAccepted routes an incoming GetAccepted request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) GetAcceptedFailed

func (sr *ChainRouter) GetAcceptedFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32)

GetAcceptedFailed routes an incoming GetAcceptedFailed request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) GetAcceptedFrontier

func (sr *ChainRouter) GetAcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32)

GetAcceptedFrontier routes an incoming GetAcceptedFrontier request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) GetAcceptedFrontierFailed

func (sr *ChainRouter) GetAcceptedFrontierFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32)

GetAcceptedFrontierFailed routes an incoming GetAcceptedFrontierFailed request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) GetFailed

func (sr *ChainRouter) GetFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)

GetFailed routes an incoming GetFailed message from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) Initialize

func (sr *ChainRouter) Initialize(log logging.Logger, timeouts *timeout.Manager)

Initialize the router When this router receives an incoming message, it cancels the timeout in [timeouts] associated with the request that caused the incoming message, if applicable

func (*ChainRouter) PullQuery

func (sr *ChainRouter) PullQuery(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)

PullQuery routes an incoming PullQuery request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) PushQuery

func (sr *ChainRouter) PushQuery(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)

PushQuery routes an incoming PushQuery request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) Put

func (sr *ChainRouter) Put(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)

Put routes an incoming Put request from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) QueryFailed

func (sr *ChainRouter) QueryFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32)

QueryFailed routes an incoming QueryFailed message from the validator with ID [validatorID] to the consensus engine working on the chain with ID [chainID]

func (*ChainRouter) RemoveChain

func (sr *ChainRouter) RemoveChain(chainID ids.ID)

RemoveChain removes the specified chain so that incoming messages can't be routed to it

func (*ChainRouter) Shutdown

func (sr *ChainRouter) Shutdown()

Shutdown shuts down this router

type ExternalRouter

type ExternalRouter interface {
	GetAcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32)
	AcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerIDs ids.Set)
	GetAccepted(validatorID ids.ShortID, 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(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID, container []byte)
	PullQuery(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)
	Chits(validatorID ids.ShortID, chainID ids.ID, requestID uint32, votes ids.Set)
}

ExternalRouter routes messages from the network to the Handler of the consensus engine that the message is intended for

type InternalRouter

type InternalRouter interface {
	GetAcceptedFrontierFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32)
	GetAcceptedFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32)
	GetFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32, containerID ids.ID)
	QueryFailed(validatorID ids.ShortID, chainID ids.ID, requestID uint32)
}

InternalRouter deals with messages internal to this node

type Router

type Router interface {
	ExternalRouter
	InternalRouter

	AddChain(chain *handler.Handler)
	RemoveChain(chainID ids.ID)
	Shutdown()
	Initialize(log logging.Logger, timeouts *timeout.Manager)
}

Router routes consensus messages to the Handler of the consensus engine that the messages are intended for

Jump to

Keyboard shortcuts

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