Documentation ¶
Index ¶
- func CompleteChallenge(srcPeerID string, m message.Message) ([]bytes.Buffer, error)
- func ProcessPing(srcPeerID string, _ message.Message) ([]bytes.Buffer, error)
- func ProcessPong(srcPeerID string, _ message.Message) ([]bytes.Buffer, error)
- type BlockHashBroker
- type CandidateBroker
- type DataBroker
- type DataRequestor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteChallenge ¶ added in v0.4.3
CompleteChallenge given by a voucher seeder.
func ProcessPing ¶ added in v0.4.0
ProcessPing will simply return 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
MarshalMempoolTxs marshals all or subset of pending Mempool transactions.
func (*DataBroker) MarshalObjects ¶ added in v0.4.0
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.