Documentation ¶
Index ¶
- func AllowedSubscription(role flow.Role, topic string) bool
- func MessageID(data []byte) string
- func MultiAddressStr(ip, port string) string
- func PeerAddressInfo(identity flow.IdentitySkeleton) (peer.AddrInfo, error)
- func PeerInfosFromIDs(ids flow.IdentityList) ([]peer.AddrInfo, map[flow.Identifier]error)
- func TopicScoreParamsLogger(logger zerolog.Logger, topicName string, topicParams *pubsub.TopicScoreParams) zerolog.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedSubscription ¶
AllowedSubscription returns true if the given role is allowed to subscribe to the topic.
func MessageID ¶ added in v0.29.0
MessageID returns the hash of the given data (used to generate the message ID for pubsub messages).
func MultiAddressStr ¶
MultiAddressStr receives a node ip and port and returns its corresponding Libp2p MultiAddressStr in string format in current implementation IP part of the node address is either an IP or a dns4. https://docs.libp2p.io/concepts/addressing/
func PeerAddressInfo ¶
func PeerAddressInfo(identity flow.IdentitySkeleton) (peer.AddrInfo, error)
PeerAddressInfo generates the libp2p peer.AddrInfo for the given Flow.Identity. A node in flow is defined by a flow.Identity while it is defined by a peer.AddrInfo in libp2p.
flow.Identity ---> peer.AddrInfo |-- Address ---> |-- []multiaddr.Multiaddr |-- NetworkPublicKey ---> |-- ID
func PeerInfosFromIDs ¶
func PeerInfosFromIDs(ids flow.IdentityList) ([]peer.AddrInfo, map[flow.Identifier]error)
PeerInfosFromIDs converts the given flow.Identity to peer.AddrInfo. For each identity, if the conversion succeeds, the peer.AddrInfo is included in the result else it is included in the error map with the corresponding error
func TopicScoreParamsLogger ¶ added in v0.32.0
func TopicScoreParamsLogger(logger zerolog.Logger, topicName string, topicParams *pubsub.TopicScoreParams) zerolog.Logger
TopicScoreParamsLogger is a helper function that returns a logger with the topic score params added as fields. Args: logger: zerolog.Logger - logger to add fields to topicName: string - name of the topic params: pubsub.TopicScoreParams - topic score params
Types ¶
This section is empty.