Documentation ¶
Index ¶
- func DefaultCreateNodeFunc(logger zerolog.Logger, host host.Host, pCache p2p.ProtocolPeerCache, ...) p2p.LibP2PNode
- func DefaultLibP2PHost(address string, key fcrypto.PrivateKey, options ...config.Option) (host.Host, error)
- func DefaultNodeBuilder(logger zerolog.Logger, address string, networkingType flownet.NetworkingType, ...) (p2p.NodeBuilder, error)
- type LibP2PNodeBuilder
- func (builder *LibP2PNodeBuilder) Build() (p2p.LibP2PNode, error)
- func (builder *LibP2PNodeBuilder) EnableGossipSubScoringWithOverride(config *p2p.PeerScoringConfigOverride) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) OverrideDefaultRpcInspectorSuiteFactory(factory p2p.GossipSubRpcInspectorSuiteFactoryFunc) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetBasicResolver(br madns.BasicResolver) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetConnectionGater(gater p2p.ConnectionGater) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetConnectionManager(manager connmgr.ConnManager) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetCreateNode(f p2p.CreateNodeFunc) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetGossipSubFactory(gf p2p.GossipSubFactoryFunc, cf p2p.GossipSubAdapterConfigFunc) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetGossipSubScoreTracerInterval(interval time.Duration) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetGossipSubTracer(tracer p2p.PubSubTracer) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetRateLimiterDistributor(distributor p2p.UnicastRateLimiterDistributor) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetResourceManager(manager network.ResourceManager) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetRoutingSystem(f func(context.Context, host.Host) (routing.Routing, error)) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetStreamCreationRetryInterval(createStreamRetryInterval time.Duration) p2p.NodeBuilder
- func (builder *LibP2PNodeBuilder) SetSubscriptionFilter(filter pubsub.SubscriptionFilter) p2p.NodeBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCreateNodeFunc ¶ added in v0.29.0
func DefaultCreateNodeFunc(logger zerolog.Logger, host host.Host, pCache p2p.ProtocolPeerCache, peerManager p2p.PeerManager, disallowListCacheCfg *p2p.DisallowListCacheConfig) p2p.LibP2PNode
DefaultCreateNodeFunc returns new libP2P node.
func DefaultLibP2PHost ¶
func DefaultLibP2PHost(address string, key fcrypto.PrivateKey, options ...config.Option) (host.Host, error)
DefaultLibP2PHost returns a libp2p host initialized to listen on the given address and using the given private key and customized with options
func DefaultNodeBuilder ¶ added in v0.29.0
func DefaultNodeBuilder( logger zerolog.Logger, address string, networkingType flownet.NetworkingType, flowKey fcrypto.PrivateKey, sporkId flow.Identifier, idProvider module.IdentityProvider, metricsCfg *p2pconfig.MetricsConfig, resolver madns.BasicResolver, role string, connGaterCfg *p2pconfig.ConnectionGaterConfig, peerManagerCfg *p2pconfig.PeerManagerConfig, gossipCfg *p2pconf.GossipSubConfig, rpcInspectorCfg *p2pconf.GossipSubRPCInspectorsConfig, rCfg *p2pconf.ResourceManagerConfig, uniCfg *p2pconfig.UnicastConfig, connMgrConfig *netconf.ConnectionManagerConfig, disallowListCacheCfg *p2p.DisallowListCacheConfig) (p2p.NodeBuilder, error)
DefaultNodeBuilder returns a node builder.
Types ¶
type LibP2PNodeBuilder ¶
type LibP2PNodeBuilder struct {
// contains filtered or unexported fields
}
func NewNodeBuilder ¶
func NewNodeBuilder( logger zerolog.Logger, metricsConfig *p2pconfig.MetricsConfig, networkingType flownet.NetworkingType, address string, networkKey fcrypto.PrivateKey, sporkId flow.Identifier, idProvider module.IdentityProvider, rCfg *p2pconf.ResourceManagerConfig, rpcInspectorCfg *p2pconf.GossipSubRPCInspectorsConfig, peerManagerConfig *p2pconfig.PeerManagerConfig, disallowListCacheCfg *p2p.DisallowListCacheConfig, rpcTracker p2p.RpcControlTracking) *LibP2PNodeBuilder
func (*LibP2PNodeBuilder) Build ¶
func (builder *LibP2PNodeBuilder) Build() (p2p.LibP2PNode, error)
Build creates a new libp2p node using the configured options.
func (*LibP2PNodeBuilder) EnableGossipSubScoringWithOverride ¶ added in v0.32.0
func (builder *LibP2PNodeBuilder) EnableGossipSubScoringWithOverride(config *p2p.PeerScoringConfigOverride) p2p.NodeBuilder
EnableGossipSubScoringWithOverride enables peer scoring for the GossipSub pubsub system with the given override. Any existing peer scoring config attribute that is set in the override will override the default peer scoring config. Anything that is left to nil or zero value in the override will be ignored and the default value will be used. Note: it is not recommended to override the default peer scoring config in production unless you know what you are doing. Production Tip: use PeerScoringConfigNoOverride as the argument to this function to enable peer scoring without any override. Args: - PeerScoringConfigOverride: override for the peer scoring config- Recommended to use PeerScoringConfigNoOverride for production. Returns: none
func (*LibP2PNodeBuilder) OverrideDefaultRpcInspectorSuiteFactory ¶ added in v0.32.0
func (builder *LibP2PNodeBuilder) OverrideDefaultRpcInspectorSuiteFactory(factory p2p.GossipSubRpcInspectorSuiteFactoryFunc) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetBasicResolver ¶
func (builder *LibP2PNodeBuilder) SetBasicResolver(br madns.BasicResolver) p2p.NodeBuilder
SetBasicResolver sets the DNS resolver for the node.
func (*LibP2PNodeBuilder) SetConnectionGater ¶
func (builder *LibP2PNodeBuilder) SetConnectionGater(gater p2p.ConnectionGater) p2p.NodeBuilder
SetConnectionGater sets the connection gater for the node.
func (*LibP2PNodeBuilder) SetConnectionManager ¶
func (builder *LibP2PNodeBuilder) SetConnectionManager(manager connmgr.ConnManager) p2p.NodeBuilder
SetConnectionManager sets the connection manager for the node.
func (*LibP2PNodeBuilder) SetCreateNode ¶ added in v0.29.0
func (builder *LibP2PNodeBuilder) SetCreateNode(f p2p.CreateNodeFunc) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetGossipSubFactory ¶ added in v0.29.0
func (builder *LibP2PNodeBuilder) SetGossipSubFactory(gf p2p.GossipSubFactoryFunc, cf p2p.GossipSubAdapterConfigFunc) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetGossipSubScoreTracerInterval ¶ added in v0.30.0
func (builder *LibP2PNodeBuilder) SetGossipSubScoreTracerInterval(interval time.Duration) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetGossipSubTracer ¶ added in v0.30.0
func (builder *LibP2PNodeBuilder) SetGossipSubTracer(tracer p2p.PubSubTracer) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetRateLimiterDistributor ¶ added in v0.30.0
func (builder *LibP2PNodeBuilder) SetRateLimiterDistributor(distributor p2p.UnicastRateLimiterDistributor) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetResourceManager ¶
func (builder *LibP2PNodeBuilder) SetResourceManager(manager network.ResourceManager) p2p.NodeBuilder
SetResourceManager sets the resource manager for the node.
func (*LibP2PNodeBuilder) SetRoutingSystem ¶
func (builder *LibP2PNodeBuilder) SetRoutingSystem(f func(context.Context, host.Host) (routing.Routing, error)) p2p.NodeBuilder
SetRoutingSystem sets the routing system factory function.
func (*LibP2PNodeBuilder) SetStreamCreationRetryInterval ¶ added in v0.30.0
func (builder *LibP2PNodeBuilder) SetStreamCreationRetryInterval(createStreamRetryInterval time.Duration) p2p.NodeBuilder
func (*LibP2PNodeBuilder) SetSubscriptionFilter ¶
func (builder *LibP2PNodeBuilder) SetSubscriptionFilter(filter pubsub.SubscriptionFilter) p2p.NodeBuilder
SetSubscriptionFilter sets the pubsub subscription filter for the node.