responding

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteChallenge added in v0.4.3

func CompleteChallenge(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

CompleteChallenge given by a voucher seeder.

func ProcessPing added in v0.4.0

func ProcessPing(srcPeerID string, _ message.Message) ([]bytes.Buffer, error)

ProcessPing will simply return a Pong message. Satisfies the peer.ProcessorFunc interface.

func ProcessPong added in v0.4.0

func ProcessPong(srcPeerID string, _ message.Message) ([]bytes.Buffer, error)

ProcessPong empty processor to process a Pong message Satisfies the peer.ProcessorFunc interface.

Types

type BlockHashBroker

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

BlockHashBroker is a processing unit which handles GetBlocks messages. It has a database connection, and a channel pointing to the outgoing message queue of the requesting peer.

func NewBlockHashBroker

func NewBlockHashBroker(db database.DB) *BlockHashBroker

NewBlockHashBroker will return an initialized BlockHashBroker.

func (*BlockHashBroker) AdvertiseMissingBlocks

func (b *BlockHashBroker) AdvertiseMissingBlocks(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

AdvertiseMissingBlocks takes a GetBlocks wire message, finds the requesting peer's height, and returns an inventory message of up to config.MaxInvBlocks blocks which follow the provided locator.

type CandidateBroker

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

CandidateBroker holds instances to RPCBus and responseChan.

func NewCandidateBroker

func NewCandidateBroker(db database.DB) *CandidateBroker

NewCandidateBroker will create new CandidateBroker.

func (*CandidateBroker) ProvideCandidate

func (c *CandidateBroker) ProvideCandidate(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

ProvideCandidate for a given (m *bytes.Buffer).

type DataBroker

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

DataBroker is a processing unit responsible for handling GetData messages. It maintains a connection to the outgoing message queue of the peer it receives this message from.

func NewDataBroker

func NewDataBroker(db database.DB, rpcBus *rpcbus.RPCBus) *DataBroker

NewDataBroker returns an initialized DataBroker.

func (*DataBroker) MarshalMempoolTxs added in v0.4.0

func (d *DataBroker) MarshalMempoolTxs(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

MarshalMempoolTxs marshals all or subset of pending Mempool transactions.

func (*DataBroker) MarshalObjects added in v0.4.0

func (d *DataBroker) MarshalObjects(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

MarshalObjects marshals requested objects by a message of type message.Inv.

type DataRequestor

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

DataRequestor is a processing unit which handles inventory messages received from peers on the Dusk wire protocol. It maintains a connection to the outgoing message queue of an individual peer.

func NewDataRequestor

func NewDataRequestor(db database.DB, rpcBus *rpcbus.RPCBus) *DataRequestor

NewDataRequestor returns an initialized DataRequestor.

func (*DataRequestor) RequestMissingItems

func (d *DataRequestor) RequestMissingItems(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

RequestMissingItems takes an inventory message, checks it for any items that the node is missing, puts these items in a GetData wire message, and sends it off to the peer's outgoing message queue, requesting the items in full. Handles topics.Inv wire messages.

Jump to

Keyboard shortcuts

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