Documentation ¶
Overview ¶
Package gowaku implements gomobile bindings for go-waku. Contains a set of functions that are exported when go-waku is exported as libraries for mobile devices
Index ¶
- func AddPeer(address string, protocolID string) string
- func Connect(address string, ms int) string
- func ConnectPeerID(peerID string, ms int) string
- func ContentTopic(applicationName string, applicationVersion string, contentTopicName string, ...) string
- func DNSDiscovery(url string, nameserver string, ms int) string
- func DecodeAsymmetric(messageJSON string, privateKey string) string
- func DecodeSymmetric(messageJSON string, symmetricKey string) string
- func DefaultPubsubTopic() string
- func Disconnect(peerID string) string
- func EncodeAsymmetric(messageJSON string, publicKey string, optionalSigningKey string) string
- func EncodeSymmetric(messageJSON string, symmetricKey string, optionalSigningKey string) string
- func FilterPing(peerID string, ms int) string
- func FilterSubscribe(filterJSON string, peerID string, ms int) string
- func FilterUnsubscribe(filterJSON string, peerID string, ms int) string
- func FilterUnsubscribeAll(peerID string, ms int) string
- func IsStarted() string
- func LegacyFilterSubscribe(filterJSON string, peerID string, ms int) string
- func LegacyFilterUnsubscribe(filterJSON string, ms int) string
- func LightpushPublish(messageJSON string, topic string, peerID string, ms int) string
- func ListenAddresses() string
- func NewNode(configJSON string) string
- func PeerCnt() string
- func PeerID() string
- func Peers() string
- func RelayEnoughPeers(topic string) string
- func RelayPublish(messageJSON string, topic string, ms int) string
- func RelaySubscribe(topic string) string
- func RelayTopics() string
- func RelayUnsubscribe(topic string) string
- func SetBootnodes(bootnodes string) string
- func SetMobileSignalHandler(handler SignalHandler)
- func Start() string
- func StartDiscoveryV5() string
- func Stop() string
- func StopDiscoveryV5() string
- func StoreLocalQuery(queryJSON string) string
- func StoreQuery(queryJSON string, peerID string, ms int) string
- type SignalHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect is used to connect to a peer at multiaddress. if ms > 0, cancel the function execution if it takes longer than N milliseconds
func ConnectPeerID ¶
ConnectPeerID is usedd to connect to a known peer by peerID. if ms > 0, cancel the function execution if it takes longer than N milliseconds
func ContentTopic ¶
func ContentTopic(applicationName string, applicationVersion string, contentTopicName string, encoding string) string
ContentTopic creates a content topic string according to RFC 23
func DNSDiscovery ¶
DNSDiscovery executes dns discovery on an url and returns a list of nodes
func DecodeAsymmetric ¶
DecodeAsymmetric decodes a waku message using a secp256k1 private key. The key must be a hex encoded string with "0x" prefix
func DecodeSymmetric ¶
DecodeSymmetric decodes a waku message using a 32 bytes symmetric key. The key must be a hex encoded string with "0x" prefix
func DefaultPubsubTopic ¶
func DefaultPubsubTopic() string
DefaultPubsubTopic returns the default pubsub topic used in waku2: /waku/2/default-waku/proto
func Disconnect ¶
Disconnect closes a connection to a known peer by peerID
func EncodeAsymmetric ¶
EncodeAsymmetric encodes a waku message using a secp256k1 public key. A secp256k1 private key can be used to optionally sign the message. The keys must be a hex encoded string with "0x" prefix
func EncodeSymmetric ¶
EncodeSymmetric encodes a waku message using a 32 bytes symmetric key. A secp256k1 private key can be used to optionally sign the message. The keys must be a hex encoded string with "0x" prefix
func FilterPing ¶
FilterPing is used to determine if a peer has an active subscription
func FilterSubscribe ¶
FilterSubscribe is used to create a subscription to a filter node to receive messages
func FilterUnsubscribe ¶
FilterUnsubscribe is used to remove a filter criteria from an active subscription with a filter node
func FilterUnsubscribeAll ¶
FilterUnsubscribeAll is used to remove an active subscription to a peer. If no peerID is defined, it will stop all active filter subscriptions
func LegacyFilterSubscribe ¶
LegacyFilterSubscribe is used to create a subscription to a filter node to receive messages Deprecated: Use FilterSubscribe instead
func LegacyFilterUnsubscribe ¶
LegacyFilterUnsubscribe is used to remove a filter criteria from an active subscription with a filter node Deprecated: Use FilterUnsubscribe or FilterUnsubscribeAll instead
func LightpushPublish ¶
LightpushPublish is used to publish a WakuMessage in a pubsub topic using Lightpush protocol
func ListenAddresses ¶
func ListenAddresses() string
ListenAddresses returns the multiaddresses the wakunode is listening to
func NewNode ¶
NewNode initializes a waku node. Receives a JSON string containing the configuration, and use default values for those config items not specified
func RelayEnoughPeers ¶
RelayEnoughPeers determines if there are enough peers to publish a message on a topic
func RelayPublish ¶
RelayPublish publishes a message using waku relay and returns the message ID
func RelaySubscribe ¶
RelaySubscribe subscribes to a WakuRelay topic.
func RelayTopics ¶
func RelayTopics() string
RelayTopics returns a list of pubsub topics the node is subscribed to in WakuRelay
func RelayUnsubscribe ¶
RelayUnsubscribe closes the pubsub subscription to a pubsub topic
func SetBootnodes ¶
SetBootnodes is used to update the bootnodes receiving a JSON array of ENRs
func SetMobileSignalHandler ¶ added in v0.9.0
func SetMobileSignalHandler(handler SignalHandler)
SetMobileSignalHandler setup geth callback to notify about new signal used for gomobile builds nolint
func StoreLocalQuery ¶
StoreLocalQuery is used to retrieve historic messages stored in the localDB using waku store protocol.
Types ¶
type SignalHandler ¶ added in v0.9.0
type SignalHandler interface {
HandleSignal(string)
}
SignalHandler defines a minimal interface a signal handler needs to implement. nolint