Documentation ¶
Index ¶
- Variables
- func CreateMailServerEvent(nodeID enode.ID, payload []byte) (*common.EnvelopeEvent, error)
- func CreateMailServerRequestCompletedPayload(requestID, lastEnvelopeHash gethcommon.Hash, cursor []byte) []byte
- func CreateMailServerRequestFailedPayload(requestID gethcommon.Hash, err error) []byte
- type Bridge
- type Config
- type Criteria
- type Info
- type MailServer
- type MailServerResponse
- type Message
- type NewMessage
- type PublicWakuAPI
- func (api *PublicWakuAPI) AddPrivateKey(ctx context.Context, privateKey hexutil.Bytes) (string, error)
- func (api *PublicWakuAPI) AddSymKey(ctx context.Context, key hexutil.Bytes) (string, error)
- func (api *PublicWakuAPI) BloomFilter() []byte
- func (api *PublicWakuAPI) CancelLightClient(ctx context.Context) bool
- func (api *PublicWakuAPI) DeleteKeyPair(ctx context.Context, key string) (bool, error)
- func (api *PublicWakuAPI) DeleteMessageFilter(id string) (bool, error)
- func (api *PublicWakuAPI) DeleteSymKey(ctx context.Context, id string) bool
- func (api *PublicWakuAPI) GenerateSymKeyFromPassword(ctx context.Context, passwd string) (string, error)
- func (api *PublicWakuAPI) GetFilterMessages(id string) ([]*Message, error)
- func (api *PublicWakuAPI) GetPrivateKey(ctx context.Context, id string) (hexutil.Bytes, error)
- func (api *PublicWakuAPI) GetPublicKey(ctx context.Context, id string) (hexutil.Bytes, error)
- func (api *PublicWakuAPI) GetSymKey(ctx context.Context, id string) (hexutil.Bytes, error)
- func (api *PublicWakuAPI) HasKeyPair(ctx context.Context, id string) bool
- func (api *PublicWakuAPI) HasSymKey(ctx context.Context, id string) bool
- func (api *PublicWakuAPI) Info(ctx context.Context) Info
- func (api *PublicWakuAPI) MakeLightClient(ctx context.Context) bool
- func (api *PublicWakuAPI) MarkTrustedPeer(ctx context.Context, url string) (bool, error)
- func (api *PublicWakuAPI) Messages(ctx context.Context, crit Criteria) (*rpc.Subscription, error)
- func (api *PublicWakuAPI) NewKeyPair(ctx context.Context) (string, error)
- func (api *PublicWakuAPI) NewMessageFilter(req Criteria) (string, error)
- func (api *PublicWakuAPI) NewSymKey(ctx context.Context) (string, error)
- func (api *PublicWakuAPI) Post(ctx context.Context, req NewMessage) (hexutil.Bytes, error)
- func (api *PublicWakuAPI) SetBloomFilter(ctx context.Context, bloom hexutil.Bytes) (bool, error)
- func (api *PublicWakuAPI) SetMaxMessageSize(ctx context.Context, size uint32) (bool, error)
- func (api *PublicWakuAPI) SetMinPoW(ctx context.Context, pow float64) (bool, error)
- func (api *PublicWakuAPI) UninstallFilter(id string)
- func (api *PublicWakuAPI) Unsubscribe(id string)
- type Waku
- func (w *Waku) APIs() []rpc.API
- func (w *Waku) AddKeyPair(key *ecdsa.PrivateKey) (string, error)
- func (w *Waku) AddSymKey(id string, key []byte) (string, error)
- func (w *Waku) AddSymKeyDirect(key []byte) (string, error)
- func (w *Waku) AddSymKeyFromPassword(password string) (string, error)
- func (w *Waku) AllowP2PMessagesFromPeer(peerID []byte) error
- func (w *Waku) BloomFilter() []byte
- func (w *Waku) BloomFilterMode() bool
- func (w *Waku) BloomFilterTolerance() []byte
- func (w *Waku) BytesRateLimits() common.RateLimits
- func (w *Waku) ConfirmationsEnabled() bool
- func (w *Waku) CurrentTime() time.Time
- func (w *Waku) DeleteKeyPair(key string) bool
- func (w *Waku) DeleteKeyPairs() error
- func (w *Waku) DeleteSymKey(id string) bool
- func (w *Waku) Envelopes() []*common.Envelope
- func (w *Waku) FullNode() bool
- func (w *Waku) GenerateSymKey() (string, error)
- func (w *Waku) GetEnvelope(hash gethcommon.Hash) *common.Envelope
- func (w *Waku) GetFilter(id string) *common.Filter
- func (w *Waku) GetPrivateKey(id string) (*ecdsa.PrivateKey, error)
- func (w *Waku) GetStats() types.StatsSummary
- func (w *Waku) GetSymKey(id string) ([]byte, error)
- func (w *Waku) HandlePeer(peer common.Peer, rw p2p.MsgReadWriter) error
- func (w *Waku) HasKeyPair(id string) bool
- func (w *Waku) HasSymKey(id string) bool
- func (w *Waku) IsEnvelopeCached(hash gethcommon.Hash) bool
- func (w *Waku) LightClientMode() bool
- func (w *Waku) LightClientModeConnectionRestricted() bool
- func (w *Waku) Mailserver() bool
- func (w *Waku) MarkP2PMessageAsProcessed(hash gethcommon.Hash)
- func (w *Waku) MaxMessageSize() uint32
- func (w *Waku) MinPow() float64
- func (w *Waku) MinPowTolerance() float64
- func (w *Waku) NewKeyPair() (string, error)
- func (w *Waku) OnBatchAcknowledged(batchHash gethcommon.Hash, p common.Peer) error
- func (w *Waku) OnDeprecatedMessagesRequest(request *common.Envelope, p common.Peer) error
- func (w *Waku) OnMessagesRequest(request common.MessagesRequest, p common.Peer) error
- func (w *Waku) OnMessagesResponse(response common.MessagesResponse, p common.Peer) error
- func (w *Waku) OnNewEnvelopes(envelopes []*common.Envelope, peer common.Peer) ([]common.EnvelopeError, error)
- func (w *Waku) OnNewP2PEnvelopes(envelopes []*common.Envelope) error
- func (w *Waku) OnP2PRequestCompleted(payload []byte, p common.Peer) error
- func (w *Waku) PacketRateLimits() common.RateLimits
- func (w *Waku) ProcessingP2PMessages() bool
- func (w *Waku) Protocols() []p2p.Protocol
- func (w *Waku) RegisterBridge(b Bridge)
- func (w *Waku) RegisterMailServer(server MailServer)
- func (w *Waku) RegisterRateLimiter(r *common.PeerRateLimiter)
- func (w *Waku) RequestHistoricMessages(peerID []byte, envelope *common.Envelope) error
- func (w *Waku) RequestHistoricMessagesWithTimeout(peerID []byte, envelope *common.Envelope, timeout time.Duration) error
- func (w *Waku) SelectKeyPair(key *ecdsa.PrivateKey) error
- func (w *Waku) Send(envelope *common.Envelope) error
- func (w *Waku) SendEnvelopeEvent(event common.EnvelopeEvent) int
- func (w *Waku) SendHistoricMessageResponse(peerID []byte, payload []byte) error
- func (w *Waku) SendMessagesRequest(peerID []byte, request common.MessagesRequest) error
- func (w *Waku) SendP2PMessages(peerID []byte, envelopes ...*common.Envelope) error
- func (w *Waku) SendRawP2PDirect(peerID []byte, envelopes ...rlp.RawValue) error
- func (w *Waku) SetBloomFilter(bloom []byte) error
- func (w *Waku) SetBloomFilterMode(mode bool)
- func (w *Waku) SetFullNode(set bool)
- func (w *Waku) SetLightClientMode(v bool)
- func (w *Waku) SetMaxMessageSize(size uint32) error
- func (w *Waku) SetMinimumPoW(val float64, tolerate bool) error
- func (w *Waku) SetTimeSource(timesource func() time.Time)
- func (w *Waku) SetTopicInterest(topicInterest []common.TopicType) error
- func (w *Waku) Start() error
- func (w *Waku) Stop() error
- func (w *Waku) Subscribe(f *common.Filter) (string, error)
- func (w *Waku) SubscribeEnvelopeEvents(events chan<- common.EnvelopeEvent) event.Subscription
- func (w *Waku) TopicInterest() []common.TopicType
- func (w *Waku) Unsubscribe(id string) error
- func (w *Waku) UnsubscribeMany(ids []string) error
- func (w *Waku) Version() uint
Constants ¶
This section is empty.
Variables ¶
var ( ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key") ErrInvalidSymmetricKey = errors.New("invalid symmetric key") ErrInvalidPublicKey = errors.New("invalid public key") ErrInvalidSigningPubKey = errors.New("invalid signing public key") ErrTooLowPoW = errors.New("message rejected, PoW too low") ErrNoTopics = errors.New("missing topic(s)") )
List of errors
var DefaultConfig = Config{ MaxMessageSize: common.DefaultMaxMessageSize, MinimumAcceptedPoW: common.DefaultMinimumPoW, RestrictLightClientsConn: true, }
Functions ¶
func CreateMailServerEvent ¶
CreateMailServerEvent returns EnvelopeEvent with correct data if payload corresponds to any of the know mailserver events: * request completed successfully * request failed If the payload is unknown/unparseable, it returns `nil`
func CreateMailServerRequestCompletedPayload ¶
func CreateMailServerRequestCompletedPayload(requestID, lastEnvelopeHash gethcommon.Hash, cursor []byte) []byte
CreateMailServerRequestCompletedPayload creates a payload representing a successful request to mailserver
func CreateMailServerRequestFailedPayload ¶
func CreateMailServerRequestFailedPayload(requestID gethcommon.Hash, err error) []byte
CreateMailServerRequestFailedPayload creates a payload representing a failed request to a mailserver
Types ¶
type Config ¶
type Config struct { MaxMessageSize uint32 `toml:",omitempty"` MinimumAcceptedPoW float64 `toml:",omitempty"` BloomFilterMode bool `toml:",omitempty"` // when true, we only match against bloom filter LightClient bool `toml:",omitempty"` // when true, it does not forward messages FullNode bool `toml:",omitempty"` // when true, it forwards all messages RestrictLightClientsConn bool `toml:",omitempty"` // when true, do not accept light client as peers if it is a light client itself EnableConfirmations bool `toml:",omitempty"` // when true, sends message confirmations SoftBlacklistedPeerIDs []string `toml:",omitempty"` }
Config represents the configuration state of a waku node.
type Criteria ¶
type Criteria struct { SymKeyID string `json:"symKeyID"` PrivateKeyID string `json:"privateKeyID"` Sig []byte `json:"sig"` MinPow float64 `json:"minPow"` Topics []common.TopicType `json:"topics"` AllowP2P bool `json:"allowP2P"` }
Criteria holds various filter options for inbound messages.
type Info ¶
type Info struct { Messages int `json:"messages"` // Number of floating messages. MinPow float64 `json:"minPow"` // Minimal accepted PoW MaxMessageSize uint32 `json:"maxMessageSize"` // Maximum accepted message size }
Info contains diagnostic information.
type MailServer ¶
type MailServer interface { Archive(env *common.Envelope) DeliverMail(peerID []byte, request *common.Envelope) // DEPRECATED; use Deliver() Deliver(peerID []byte, request common.MessagesRequest) }
MailServer represents a mail server, capable of archiving the old messages for subsequent delivery to the peers. Any implementation must ensure that both functions are thread-safe. Also, they must return ASAP. DeliverMail should use p2pMessageCode for delivery, in order to bypass the expiry checks.
type MailServerResponse ¶
type MailServerResponse struct { LastEnvelopeHash gethcommon.Hash Cursor []byte Error error }
MailServerResponse is the response payload sent by the mailserver.
type Message ¶
type Message struct { Sig []byte `json:"sig,omitempty"` TTL uint32 `json:"ttl"` Timestamp uint32 `json:"timestamp"` Topic common.TopicType `json:"topic"` Payload []byte `json:"payload"` Padding []byte `json:"padding"` PoW float64 `json:"pow"` Hash []byte `json:"hash"` Dst []byte `json:"recipientPublicKey,omitempty"` P2P bool `json:"bool,omitempty"` }
Message is the RPC representation of a waku message.
func ToWakuMessage ¶
func ToWakuMessage(message *common.ReceivedMessage) *Message
ToWakuMessage converts an internal message into an API version.
type NewMessage ¶
type NewMessage struct { SymKeyID string `json:"symKeyID"` PublicKey []byte `json:"pubKey"` Sig string `json:"sig"` TTL uint32 `json:"ttl"` Topic common.TopicType `json:"topic"` Payload []byte `json:"payload"` Padding []byte `json:"padding"` PowTime uint32 `json:"powTime"` PowTarget float64 `json:"powTarget"` TargetPeer string `json:"targetPeer"` }
NewMessage represents a new waku message that is posted through the RPC.
type PublicWakuAPI ¶
type PublicWakuAPI struct {
// contains filtered or unexported fields
}
PublicWakuAPI provides the waku RPC service that can be use publicly without security implications.
func NewPublicWakuAPI ¶
func NewPublicWakuAPI(w *Waku) *PublicWakuAPI
NewPublicWakuAPI create a new RPC waku service.
func (*PublicWakuAPI) AddPrivateKey ¶
func (api *PublicWakuAPI) AddPrivateKey(ctx context.Context, privateKey hexutil.Bytes) (string, error)
AddPrivateKey imports the given private key.
func (*PublicWakuAPI) AddSymKey ¶
AddSymKey import a symmetric key. It returns an ID that can be used to refer to the key. Can be used encrypting and decrypting messages where the key is known to both parties.
func (*PublicWakuAPI) BloomFilter ¶ added in v0.85.0
func (api *PublicWakuAPI) BloomFilter() []byte
func (*PublicWakuAPI) CancelLightClient ¶
func (api *PublicWakuAPI) CancelLightClient(ctx context.Context) bool
CancelLightClient cancels light client mode.
func (*PublicWakuAPI) DeleteKeyPair ¶
DeleteKeyPair removes the key with the given key if it exists.
func (*PublicWakuAPI) DeleteMessageFilter ¶
func (api *PublicWakuAPI) DeleteMessageFilter(id string) (bool, error)
DeleteMessageFilter deletes a filter.
func (*PublicWakuAPI) DeleteSymKey ¶
func (api *PublicWakuAPI) DeleteSymKey(ctx context.Context, id string) bool
DeleteSymKey deletes the symmetric key that is associated with the given id.
func (*PublicWakuAPI) GenerateSymKeyFromPassword ¶
func (api *PublicWakuAPI) GenerateSymKeyFromPassword(ctx context.Context, passwd string) (string, error)
GenerateSymKeyFromPassword derive a key from the given password, stores it, and returns its ID.
func (*PublicWakuAPI) GetFilterMessages ¶
func (api *PublicWakuAPI) GetFilterMessages(id string) ([]*Message, error)
GetFilterMessages returns the messages that match the filter criteria and are received between the last poll and now.
func (*PublicWakuAPI) GetPrivateKey ¶
GetPrivateKey returns the private key associated with the given key. The key is the hex encoded representation of a key in the form specified in section 4.3.6 of ANSI X9.62.
func (*PublicWakuAPI) GetPublicKey ¶
GetPublicKey returns the public key associated with the given key. The key is the hex encoded representation of a key in the form specified in section 4.3.6 of ANSI X9.62.
func (*PublicWakuAPI) HasKeyPair ¶
func (api *PublicWakuAPI) HasKeyPair(ctx context.Context, id string) bool
HasKeyPair returns an indication if the node has a key pair that is associated with the given id.
func (*PublicWakuAPI) HasSymKey ¶
func (api *PublicWakuAPI) HasSymKey(ctx context.Context, id string) bool
HasSymKey returns an indication if the node has a symmetric key associated with the given key.
func (*PublicWakuAPI) Info ¶
func (api *PublicWakuAPI) Info(ctx context.Context) Info
Info returns diagnostic information about the waku node.
func (*PublicWakuAPI) MakeLightClient ¶
func (api *PublicWakuAPI) MakeLightClient(ctx context.Context) bool
MakeLightClient turns the node into light client, which does not forward any incoming messages, and sends only messages originated in this node.
func (*PublicWakuAPI) MarkTrustedPeer ¶
MarkTrustedPeer marks a peer trusted, which will allow it to send historic (expired) messages. Note: This function is not adding new nodes, the node needs to exists as a peer.
func (*PublicWakuAPI) Messages ¶
func (api *PublicWakuAPI) Messages(ctx context.Context, crit Criteria) (*rpc.Subscription, error)
Messages set up a subscription that fires events when messages arrive that match the given set of criteria.
func (*PublicWakuAPI) NewKeyPair ¶
func (api *PublicWakuAPI) NewKeyPair(ctx context.Context) (string, error)
NewKeyPair generates a new public and private key pair for message decryption and encryption. It returns an ID that can be used to refer to the keypair.
func (*PublicWakuAPI) NewMessageFilter ¶
func (api *PublicWakuAPI) NewMessageFilter(req Criteria) (string, error)
NewMessageFilter creates a new filter that can be used to poll for (new) messages that satisfy the given criteria.
func (*PublicWakuAPI) NewSymKey ¶
func (api *PublicWakuAPI) NewSymKey(ctx context.Context) (string, error)
NewSymKey generate a random symmetric key. It returns an ID that can be used to refer to the key. Can be used encrypting and decrypting messages where the key is known to both parties.
func (*PublicWakuAPI) Post ¶
func (api *PublicWakuAPI) Post(ctx context.Context, req NewMessage) (hexutil.Bytes, error)
Post posts a message on the Waku network. returns the hash of the message in case of success.
func (*PublicWakuAPI) SetBloomFilter ¶
SetBloomFilter sets the new value of bloom filter, and notifies the peers.
func (*PublicWakuAPI) SetMaxMessageSize ¶
SetMaxMessageSize sets the maximum message size that is accepted. Upper limit is defined by MaxMessageSize.
func (*PublicWakuAPI) UninstallFilter ¶
func (api *PublicWakuAPI) UninstallFilter(id string)
UninstallFilter is alias for Unsubscribe
func (*PublicWakuAPI) Unsubscribe ¶
func (api *PublicWakuAPI) Unsubscribe(id string)
Unsubscribe disables and removes an existing filter.
type Waku ¶
type Waku struct {
// contains filtered or unexported fields
}
Waku represents a dark communication interface through the Ethereum network, using its very own P2P communication layer.
func (*Waku) AddKeyPair ¶
func (w *Waku) AddKeyPair(key *ecdsa.PrivateKey) (string, error)
AddKeyPair imports a asymmetric private key and returns it identifier.
func (*Waku) AddSymKeyDirect ¶
AddSymKeyDirect stores the key, and returns its id.
func (*Waku) AddSymKeyFromPassword ¶
AddSymKeyFromPassword generates the key from password, stores it, and returns its id.
func (*Waku) AllowP2PMessagesFromPeer ¶
AllowP2PMessagesFromPeer marks specific peer trusted, which will allow it to send historic (expired) messages.
func (*Waku) BloomFilter ¶
BloomFilter returns the aggregated bloom filter for all the topics of interest. The nodes are required to send only messages that match the advertised bloom filter. If a message does not match the bloom, it will tantamount to spam, and the peer will be disconnected.
func (*Waku) BloomFilterMode ¶
BloomFilterMode returns whether the node is running in bloom filter mode
func (*Waku) BloomFilterTolerance ¶
BloomFilterTolerance returns the bloom filter which is tolerated for a limited time after new bloom was advertised to the peers. If sufficient time have elapsed or no change of bloom filter have ever occurred, the return value will be the same as return value of BloomFilter().
func (*Waku) BytesRateLimits ¶ added in v0.55.1
func (w *Waku) BytesRateLimits() common.RateLimits
BytesRateLimiting returns RateLimits information for bytes
func (*Waku) ConfirmationsEnabled ¶
ConfirmationsEnabled returns true if message confirmations are enabled.
func (*Waku) DeleteKeyPair ¶
DeleteKeyPair deletes the specified key if it exists.
func (*Waku) DeleteKeyPairs ¶
DeleteKeyPairs removes all cryptographic identities known to the node
func (*Waku) DeleteSymKey ¶
DeleteSymKey deletes the key associated with the name string if it exists.
func (*Waku) GenerateSymKey ¶
GenerateSymKey generates a random symmetric key and stores it under id, which is then returned. Will be used in the future for session key exchange.
func (*Waku) GetEnvelope ¶
func (w *Waku) GetEnvelope(hash gethcommon.Hash) *common.Envelope
GetEnvelope retrieves an envelope from the message queue by its hash. It returns nil if the envelope can not be found.
func (*Waku) GetPrivateKey ¶
func (w *Waku) GetPrivateKey(id string) (*ecdsa.PrivateKey, error)
GetPrivateKey retrieves the private key of the specified identity.
func (*Waku) GetStats ¶ added in v0.83.8
func (w *Waku) GetStats() types.StatsSummary
func (*Waku) HandlePeer ¶
HandlePeer is called by the underlying P2P layer when the waku sub-protocol connection is negotiated.
func (*Waku) HasKeyPair ¶
HasKeyPair checks if the waku node is configured with the private key of the specified public pair.
func (*Waku) HasSymKey ¶
HasSymKey returns true if there is a key associated with the given id. Otherwise returns false.
func (*Waku) IsEnvelopeCached ¶ added in v0.53.0
func (w *Waku) IsEnvelopeCached(hash gethcommon.Hash) bool
isEnvelopeCached checks if envelope with specific hash has already been received and cached.
func (*Waku) LightClientMode ¶
LightClientMode indicates is this node is light client (does not forward any messages)
func (*Waku) LightClientModeConnectionRestricted ¶
LightClientModeConnectionRestricted indicates that connection to light client in light client mode not allowed
func (*Waku) Mailserver ¶ added in v0.53.0
func (*Waku) MarkP2PMessageAsProcessed ¶ added in v0.91.12
func (w *Waku) MarkP2PMessageAsProcessed(hash gethcommon.Hash)
func (*Waku) MaxMessageSize ¶
MaxMessageSize returns the maximum accepted message size.
func (*Waku) MinPowTolerance ¶
MinPowTolerance returns the value of minimum PoW which is tolerated for a limited time after PoW was changed. If sufficient time have elapsed or no change of PoW have ever occurred, the return value will be the same as return value of MinPow().
func (*Waku) NewKeyPair ¶
NewKeyPair generates a new cryptographic identity for the client, and injects it into the known identities for message decryption. Returns ID of the new key pair.
func (*Waku) OnBatchAcknowledged ¶ added in v0.53.0
func (*Waku) OnDeprecatedMessagesRequest ¶ added in v0.53.2
func (*Waku) OnMessagesRequest ¶ added in v0.53.0
func (*Waku) OnMessagesResponse ¶ added in v0.53.0
func (*Waku) OnNewEnvelopes ¶ added in v0.53.0
func (*Waku) OnNewP2PEnvelopes ¶ added in v0.53.0
func (*Waku) OnP2PRequestCompleted ¶ added in v0.53.0
func (*Waku) PacketRateLimits ¶ added in v0.55.1
func (w *Waku) PacketRateLimits() common.RateLimits
PacketRateLimiting returns RateLimits information for packets
func (*Waku) ProcessingP2PMessages ¶ added in v0.91.12
func (*Waku) RegisterBridge ¶
RegisterBridge registers a new Bridge that moves envelopes between different subprotocols. It's important that a bridge is registered before the service is started, otherwise, it won't read and propagate envelopes.
func (*Waku) RegisterMailServer ¶
func (w *Waku) RegisterMailServer(server MailServer)
RegisterMailServer registers MailServer interface. MailServer will process all the incoming messages with p2pRequestCode.
func (*Waku) RegisterRateLimiter ¶
func (w *Waku) RegisterRateLimiter(r *common.PeerRateLimiter)
SetRateLimiter registers a rate limiter.
func (*Waku) RequestHistoricMessages ¶
RequestHistoricMessages sends a message with p2pRequestCode to a specific peer, which is known to implement MailServer interface, and is supposed to process this request and respond with a number of peer-to-peer messages (possibly expired), which are not supposed to be forwarded any further. The waku protocol is agnostic of the format and contents of envelope.
func (*Waku) RequestHistoricMessagesWithTimeout ¶
func (w *Waku) RequestHistoricMessagesWithTimeout(peerID []byte, envelope *common.Envelope, timeout time.Duration) error
RequestHistoricMessagesWithTimeout acts as RequestHistoricMessages but requires to pass a timeout. It sends an event EventMailServerRequestExpired after the timeout.
func (*Waku) SelectKeyPair ¶
func (w *Waku) SelectKeyPair(key *ecdsa.PrivateKey) error
SelectKeyPair adds cryptographic identity, and makes sure that it is the only private key known to the node.
func (*Waku) Send ¶
Send injects a message into the waku send queue, to be distributed in the network in the coming cycles.
func (*Waku) SendEnvelopeEvent ¶ added in v0.53.0
func (w *Waku) SendEnvelopeEvent(event common.EnvelopeEvent) int
func (*Waku) SendHistoricMessageResponse ¶
func (*Waku) SendMessagesRequest ¶
func (w *Waku) SendMessagesRequest(peerID []byte, request common.MessagesRequest) error
func (*Waku) SendP2PMessages ¶
SendP2PMessage sends a peer-to-peer message to a specific peer. It sends one or more envelopes in a single batch.
func (*Waku) SendRawP2PDirect ¶
SendRawP2PDirect sends a peer-to-peer message to a specific peer. It sends one or more envelopes in a single batch.
func (*Waku) SetBloomFilter ¶
SetBloomFilter sets the new bloom filter
func (*Waku) SetBloomFilterMode ¶
func (*Waku) SetFullNode ¶ added in v0.59.0
func (*Waku) SetLightClientMode ¶
SetLightClientMode makes node light client (does not forward any messages)
func (*Waku) SetMaxMessageSize ¶
SetMaxMessageSize sets the maximal message size allowed by this node
func (*Waku) SetMinimumPoW ¶
SetMinimumPoW sets the minimal PoW required by this node
func (*Waku) SetTimeSource ¶
SetTimeSource assigns a particular source of time to a waku object.
func (*Waku) SetTopicInterest ¶
SetTopicInterest sets the new topicInterest
func (*Waku) Start ¶
Start implements node.Service, starting the background data propagation thread of the Waku protocol.
func (*Waku) Stop ¶
Stop implements node.Service, stopping the background data propagation thread of the Waku protocol.
func (*Waku) Subscribe ¶
Subscribe installs a new message handler used for filtering, decrypting and subsequent storing of incoming messages.
func (*Waku) SubscribeEnvelopeEvents ¶
func (w *Waku) SubscribeEnvelopeEvents(events chan<- common.EnvelopeEvent) event.Subscription
SubscribeEnvelopeEvents subscribes to envelopes feed. In order to prevent blocking waku producers events must be amply buffered.
func (*Waku) TopicInterest ¶
TopicInterest returns the all the topics of interest. The nodes are required to send only messages that match the advertised topics. If a message does not match the topic-interest, it will tantamount to spam, and the peer will be disconnected.
func (*Waku) Unsubscribe ¶
Unsubscribe removes an installed message handler. TODO: This does not seem to update the bloom filter, but does update the topic interest map
func (*Waku) UnsubscribeMany ¶ added in v0.69.0
Unsubscribe removes an installed message handler. TODO: This does not seem to update the bloom filter, but does update the topic interest map