mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-27 00:55:17 +00:00
31 lines
929 B
Go
31 lines
929 B
Go
package p2p
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
"source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub/pb"
|
|
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
|
)
|
|
|
|
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
|
|
StartDirectChannelListener(
|
|
key []byte,
|
|
server *grpc.Server,
|
|
) error
|
|
GetDirectChannel(peerId []byte) (*grpc.ClientConn, error)
|
|
GetNetworkInfo() *protobufs.NetworkInfoResponse
|
|
SignMessage(msg []byte) ([]byte, error)
|
|
GetPublicKey() []byte
|
|
GetPeerScore(peerId []byte) int64
|
|
SetPeerScore(peerId []byte, score int64)
|
|
}
|