Documentation
¶
Index ¶
- Constants
- func NewPeer(host common.WakuHost, p2pPeer *p2p.Peer, rw p2p.MsgReadWriter, ...) common.Peer
- type MultiVersionResponse
- type Peer
- func (p *Peer) BloomFilter() []byte
- func (p *Peer) ConfirmationsEnabled() bool
- func (p *Peer) EnodeID() enode.ID
- func (p *Peer) ID() []byte
- func (p *Peer) IP() net.IP
- func (p *Peer) Mark(envelope *common.Envelope)
- func (p *Peer) Marked(envelope *common.Envelope) bool
- func (p *Peer) NotifyAboutBloomFilterChange(bloom []byte) error
- func (p *Peer) NotifyAboutPowRequirementChange(pow float64) error
- func (p *Peer) NotifyAboutTopicInterestChange(topics []common.TopicType) error
- func (p *Peer) PoWRequirement() float64
- func (p *Peer) RequestHistoricMessages(envelope *common.Envelope) error
- func (p *Peer) Run() error
- func (p *Peer) SendHistoricMessageResponse(payload []byte) error
- func (p *Peer) SendMessagesRequest(request common.MessagesRequest) error
- func (p *Peer) SendP2PMessages(envelopes []*common.Envelope) error
- func (p *Peer) SendRawP2PDirect(envelopes []rlp.RawValue) error
- func (p *Peer) SetPeerTrusted(trusted bool)
- func (p *Peer) SetRWWriter(rw p2p.MsgReadWriter)
- func (p *Peer) Start() error
- func (p *Peer) Stop()
- type StatusOptions
- func (o *StatusOptions) DecodeRLP(s *rlp.Stream) error
- func (o StatusOptions) EncodeRLP(w io.Writer) error
- func (o StatusOptions) PoWRequirementF() *float64
- func (o *StatusOptions) SetPoWRequirementFromF(val float64)
- func (o StatusOptions) Validate() error
- func (o StatusOptions) WithDefaults() StatusOptions
- type Version1MessageResponse
Constants ¶
const ( Version = uint64(1) // Peer version number VersionStr = "1" // The same, as a string Name = "waku" // Nickname of the protocol NumberOfMessageCodes = 128 )
Waku protocol parameters
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MultiVersionResponse ¶
MultiVersionResponse allows to decode response into chosen version.
func (MultiVersionResponse) DecodeResponse1 ¶
func (m MultiVersionResponse) DecodeResponse1() (resp common.MessagesResponse, err error)
DecodeResponse1 decodes response into first version of the messages response.
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) BloomFilter ¶
func (*Peer) ConfirmationsEnabled ¶
func (*Peer) NotifyAboutBloomFilterChange ¶
func (*Peer) NotifyAboutPowRequirementChange ¶
func (*Peer) NotifyAboutTopicInterestChange ¶
func (*Peer) PoWRequirement ¶
func (*Peer) RequestHistoricMessages ¶
func (*Peer) SendHistoricMessageResponse ¶
func (*Peer) SendMessagesRequest ¶
func (p *Peer) SendMessagesRequest(request common.MessagesRequest) error
func (*Peer) SetPeerTrusted ¶
func (*Peer) SetRWWriter ¶
func (p *Peer) SetRWWriter(rw p2p.MsgReadWriter)
type StatusOptions ¶
type StatusOptions struct { PoWRequirement *uint64 `rlp:"key=0"` // RLP does not support float64 natively BloomFilter []byte `rlp:"key=1"` LightNodeEnabled *bool `rlp:"key=2"` ConfirmationsEnabled *bool `rlp:"key=3"` RateLimits *common.RateLimits `rlp:"key=4"` TopicInterest []common.TopicType `rlp:"key=5"` }
StatusOptions defines additional information shared between peers during the handshake. There might be more options provided then fields in StatusOptions and they should be ignored during deserialization to stay forward compatible. In the case of RLP, options should be serialized to an array of tuples where the first item is a field name and the second is a RLP-serialized value.
func StatusOptionsFromHost ¶
func StatusOptionsFromHost(host common.WakuHost) StatusOptions
func (StatusOptions) PoWRequirementF ¶
func (o StatusOptions) PoWRequirementF() *float64
func (*StatusOptions) SetPoWRequirementFromF ¶
func (o *StatusOptions) SetPoWRequirementFromF(val float64)
func (StatusOptions) Validate ¶
func (o StatusOptions) Validate() error
func (StatusOptions) WithDefaults ¶
func (o StatusOptions) WithDefaults() StatusOptions
WithDefaults adds the default values for a given peer. This are not the host default values, but the default values that ought to be used when receiving from an update from a peer.
type Version1MessageResponse ¶
type Version1MessageResponse struct { Version uint Response common.MessagesResponse }
Version1MessageResponse first version of the message response.
func NewMessagesResponse ¶
func NewMessagesResponse(batch gethcommon.Hash, errors []common.EnvelopeError) Version1MessageResponse
NewMessagesResponse returns instance of the version messages response.