status-go/protocol/messenger_peers.go
kaichao 47899fd045
feat_: hash based query for outgoing messages. (#5217)
* feat_: hash based query for outgoing messages.

* chore_: more logs

* chore_: fix comments

* chore_: do not lock when send queries

* chore_: use constant for magic number

* chore_: remove message ids from query queue after ack

* chore_: fix ack clean process

* chore_: fix message resend test

* chore_: add test for waku confirm message sent.

* chore_: fix tests.

* chore_: fix more

* chore_: set store peer id when mailserver updates

* fix_: tests

* chore_: increase max hash query length

* chore_: remove debug log of ack message

* chore_: remove automatic peer selection

* chore_: mark raw message to sent after ack

* chore_: fix test

* chore_: fix test
2024-06-11 15:45:01 +08:00

47 lines
1.2 KiB
Go

package protocol
import (
"crypto/ecdsa"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/status-im/status-go/eth-node/types"
)
func (m *Messenger) AddStorePeer(address string) (peer.ID, error) {
return m.transport.AddStorePeer(address)
}
func (m *Messenger) AddRelayPeer(address string) (peer.ID, error) {
return m.transport.AddRelayPeer(address)
}
func (m *Messenger) DialPeer(address string) error {
return m.transport.DialPeer(address)
}
func (m *Messenger) DialPeerByID(peerID string) error {
return m.transport.DialPeerByID(peerID)
}
func (m *Messenger) DropPeer(peerID string) error {
return m.transport.DropPeer(peerID)
}
func (m *Messenger) Peers() map[string]types.WakuV2Peer {
return m.transport.Peers()
}
func (m *Messenger) ListenAddresses() ([]string, error) {
return m.transport.ListenAddresses()
}
// Subscribe to a pubsub topic, passing an optional public key if the pubsub topic is protected
func (m *Messenger) SubscribeToPubsubTopic(topic string, optPublicKey *ecdsa.PublicKey) error {
return m.transport.SubscribeToPubsubTopic(topic, optPublicKey)
}
func (m *Messenger) StorePubsubTopicKey(topic string, privKey *ecdsa.PrivateKey) error {
return m.transport.StorePubsubTopicKey(topic, privKey)
}