ceremonyclient/node/p2p/pubsub.go
2023-09-29 02:55:09 -05:00

19 lines
519 B
Go

package p2p
import (
"source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub/pb"
)
type PubSub interface {
PublishToBitmask(bitmask []byte, data []byte) error
Publish(data []byte) error
Subscribe(bitmask []byte, handler func(message *pb.Message) error, raw bool)
Unsubscribe(bitmask []byte, raw bool)
GetPeerID() []byte
GetBitmaskPeers() map[string][]string
GetPeerstoreCount() int
GetNetworkPeersCount() int
GetRandomPeer(bitmask []byte) ([]byte, error)
GetMultiaddrOfPeer(peerId []byte) string
}