Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateRPCInspector ¶
type AggregateRPCInspector struct {
// contains filtered or unexported fields
}
AggregateRPCInspector gossip sub RPC inspector that combines multiple RPC inspectors into a single inspector. Each individual inspector will be invoked synchronously.
func NewAggregateRPCInspector ¶
func NewAggregateRPCInspector(inspectors ...p2p.GossipSubRPCInspector) *AggregateRPCInspector
NewAggregateRPCInspector returns new aggregate RPC inspector.
func (*AggregateRPCInspector) Inspect ¶
Inspect func with the p2p.GossipSubAppSpecificRpcInspector func signature that will invoke all the configured inspectors.
func (*AggregateRPCInspector) Inspectors ¶
func (a *AggregateRPCInspector) Inspectors() []p2p.GossipSubRPCInspector
type GossipSubInspectorSuite ¶
type GossipSubInspectorSuite struct { component.Component // contains filtered or unexported fields }
GossipSubInspectorSuite encapsulates what is exposed to the libp2p node regarding the gossipsub RPC inspectors as well as their notification distributors.
func NewGossipSubInspectorSuite ¶
func NewGossipSubInspectorSuite(inspectors []p2p.GossipSubRPCInspector, ctrlMsgInspectDistributor p2p.GossipSubInspectorNotifDistributor) *GossipSubInspectorSuite
NewGossipSubInspectorSuite creates a new GossipSubInspectorSuite. The suite is composed of the aggregated inspector, which is used to inspect the gossipsub rpc messages, and the control message notification distributor, which is used to notify consumers when a misbehaving peer regarding gossipsub control messages is detected. The suite is also a component, which is used to start and stop the rpc inspectors. Args:
- inspectors: the rpc inspectors that are used to inspect the gossipsub rpc messages.
- ctrlMsgInspectDistributor: the notification distributor that is used to notify consumers when a misbehaving peer
regarding gossipsub control messages is detected. Returns:
- the new GossipSubInspectorSuite.
func (*GossipSubInspectorSuite) AddInvCtrlMsgNotifConsumer ¶
func (s *GossipSubInspectorSuite) AddInvCtrlMsgNotifConsumer(c p2p.GossipSubInvCtrlMsgNotifConsumer)
AddInvalidCtrlMsgNotificationConsumer adds a consumer to the invalid control message notification distributor. This consumer is notified when a misbehaving peer regarding gossipsub control messages is detected. This follows a pub/sub pattern where the consumer is notified when a new notification is published. A consumer is only notified once for each notification, and only receives notifications that were published after it was added.
func (*GossipSubInspectorSuite) InspectFunc ¶
InspectFunc returns the inspect function that is used to inspect the gossipsub rpc messages. This function follows a dependency injection pattern, where the inspect function is injected into the gossipsu, and is called whenever a gossipsub rpc message is received.
func (*GossipSubInspectorSuite) Inspectors ¶
func (s *GossipSubInspectorSuite) Inspectors() []p2p.GossipSubRPCInspector
Inspectors returns all inspectors in the inspector suite.