Documentation ¶
Index ¶
Constants ¶
const (
MaxFrameSize = uint64(250000)
)
Variables ¶
This section is empty.
Functions ¶
func GetMempoolTxs ¶
func GetMempoolTxs(bus *wire.RPCBus, txID []byte) ([]transactions.Transaction, error)
GetMempoolTxs is a wire.GetMempoolTx API wrapper. Later it could be moved into a separate utils pkg
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, responseChan chan<- *bytes.Buffer) *BlockHashBroker
NewBlockHashBroker will return an initialized BlockHashBroker.
func (*BlockHashBroker) AdvertiseMissingBlocks ¶
func (b *BlockHashBroker) AdvertiseMissingBlocks(m *bytes.Buffer) error
AdvertiseMissingBlocks takes a GetBlocks wire message, finds the requesting peer's height, and returns an inventory message of up to 500 blocks which follow the provided locator.
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 *wire.RPCBus, responseChan chan<- *bytes.Buffer) *DataBroker
NewDataBroker returns an initialized DataBroker.
func (*DataBroker) SendItems ¶
func (d *DataBroker) SendItems(m *bytes.Buffer) error
SendItems takes a GetData message from the wire, and iterates through the list, sending back each item's complete data to the requesting peer.
func (*DataBroker) SendTxsItems ¶
func (d *DataBroker) SendTxsItems() error
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 *wire.RPCBus, responseChan chan<- *bytes.Buffer) *DataRequestor
NewDataRequestor returns an initialized DataRequestor.
func (*DataRequestor) RequestMempoolItems ¶
func (d *DataRequestor) RequestMempoolItems() error
RequestMempoolItems sends topics.Mempool to request available mempool txs
func (*DataRequestor) RequestMissingItems ¶
func (d *DataRequestor) RequestMissingItems(m *bytes.Buffer) error
AskForMissingItems 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.
type Gossip ¶
type Gossip struct {
// contains filtered or unexported fields
}
Gossip is a preprocessor for gossip messages.