Documentation ¶
Index ¶
- Constants
- Variables
- func AddrFilters(filters []string) func() (*ma.Filters, Libp2pOpts, error)
- func AddrsFactory(announce []string, appendAnnouce []string, noAnnounce []string) func() (opts Libp2pOpts, err error)
- func AutoNATService(throttle *config.AutoNATThrottleConfig) func() Libp2pOpts
- func AutoRelay(staticRelays []string, peerChan <-chan peer.AddrInfo) func() (opts Libp2pOpts, err error)
- func AutoRelayFeeder(cfgPeering config.Peering) func(fx.Lifecycle, host.Host, AddrInfoChan, *ddht.DHT)
- func BaseRouting(experimentalDHTClient bool) interface{}
- func ConnectionManager(low, high int, grace time.Duration) func() (opts Libp2pOpts, err error)
- func DiscoveryHandler(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host) *discoveryHandler
- func FloodSub(pubsubOptions ...pubsub.Option) interface{}
- func ForceReachability(val *config.OptionalString) func() (opts Libp2pOpts, err error)
- func GossipSub(pubsubOptions ...pubsub.Option) interface{}
- func HolePunching(flag config.Flag, hasRelayClient bool) func() (opts Libp2pOpts, err error)
- func NetLimit(mgr network.ResourceManager, scope string) (rcmgr.BasicLimitConfig, error)
- func NetSetLimit(mgr network.ResourceManager, repo repo.Repo, scope string, ...) error
- func PNet(repo repo.Repo) (opts Libp2pOpts, fp PNetFingerprint, err error)
- func PNetChecker(repo repo.Repo, ph host.Host, lc fx.Lifecycle) error
- func Peerstore(lc fx.Lifecycle) (peerstore.Peerstore, error)
- func PstoreAddSelfKeys(id peer.ID, sk crypto.PrivKey, ps peerstore.Peerstore) error
- func PubsubRouter(mctx helpers.MetricsCtx, lc fx.Lifecycle, in p2pPSRoutingIn) (p2pRouterOut, *namesys.PubsubValueStore, error)
- func RelayService(enable bool, relayOpts config.RelayService) func() (opts Libp2pOpts, err error)
- func RelayTransport(enableRelay bool) func() (opts Libp2pOpts, err error)
- func ResourceManager(cfg config.SwarmConfig) func(fx.Lifecycle, repo.Repo) (network.ResourceManager, Libp2pOpts, error)
- func Routing(in p2pOnlineRoutingIn) routing.Routing
- func Security(enabled bool, tptConfig config.Transports) interface{}
- func SetupDiscovery(useMdns bool, mdnsInterval int) func(helpers.MetricsCtx, fx.Lifecycle, host.Host, *discoveryHandler) error
- func SmuxTransport(tptConfig config.Transports) func() (opts Libp2pOpts, err error)
- func StartListening(addresses []string) func(host host.Host) error
- func TopicDiscovery() interface{}
- func Transports(tptConfig config.Transports) interface{}
- type AddrInfoChan
- type BaseIpfsRouting
- type HostOption
- type Libp2pOpts
- type NetStatOut
- type P2PHostIn
- type P2PHostOut
- type PNetFingerprint
- type Router
- type RoutingOption
Constants ¶
View Source
const NetLimitDefaultFilename = "limit.json"
View Source
const NetLimitTraceFilename = "rcmgr.json.gz"
Variables ¶
View Source
var ( DHTOption RoutingOption = constructDHTRouting(dht.ModeAuto) DHTClientOption = constructDHTRouting(dht.ModeClient) DHTServerOption = constructDHTRouting(dht.ModeServer) NilRouterOption = constructNilRouting )
View Source
var NatPortMap = simpleOpt(libp2p.NATPortMap())
View Source
var NoResourceMgrError = fmt.Errorf("missing ResourceMgr: make sure the daemon is running with Swarm.ResourceMgr.Enabled")
View Source
var UserAgent = simpleOpt(libp2p.UserAgent(version.GetUserAgentVersion()))
Misc options
Functions ¶
func AddrFilters ¶
func AddrFilters(filters []string) func() (*ma.Filters, Libp2pOpts, error)
func AddrsFactory ¶
func AddrsFactory(announce []string, appendAnnouce []string, noAnnounce []string) func() (opts Libp2pOpts, err error)
func AutoNATService ¶
func AutoNATService(throttle *config.AutoNATThrottleConfig) func() Libp2pOpts
func AutoRelay ¶ added in v0.5.0
func AutoRelay(staticRelays []string, peerChan <-chan peer.AddrInfo) func() (opts Libp2pOpts, err error)
func AutoRelayFeeder ¶ added in v0.13.0
func BaseRouting ¶
func BaseRouting(experimentalDHTClient bool) interface{}
func ConnectionManager ¶
func ConnectionManager(low, high int, grace time.Duration) func() (opts Libp2pOpts, err error)
func DiscoveryHandler ¶
func ForceReachability ¶ added in v0.11.0
func ForceReachability(val *config.OptionalString) func() (opts Libp2pOpts, err error)
func HolePunching ¶ added in v0.11.0
func HolePunching(flag config.Flag, hasRelayClient bool) func() (opts Libp2pOpts, err error)
func NetLimit ¶ added in v0.13.0
func NetLimit(mgr network.ResourceManager, scope string) (rcmgr.BasicLimitConfig, error)
func NetSetLimit ¶ added in v0.13.0
func NetSetLimit(mgr network.ResourceManager, repo repo.Repo, scope string, limit rcmgr.BasicLimitConfig) error
NetSetLimit sets new ResourceManager limits for the given scope. The limits take effect immediately, and are also persisted to the repo config.
func PNet ¶
func PNet(repo repo.Repo) (opts Libp2pOpts, fp PNetFingerprint, err error)
func PstoreAddSelfKeys ¶
func PubsubRouter ¶
func PubsubRouter(mctx helpers.MetricsCtx, lc fx.Lifecycle, in p2pPSRoutingIn) (p2pRouterOut, *namesys.PubsubValueStore, error)
func RelayService ¶ added in v0.11.0
func RelayService(enable bool, relayOpts config.RelayService) func() (opts Libp2pOpts, err error)
func RelayTransport ¶ added in v0.11.0
func RelayTransport(enableRelay bool) func() (opts Libp2pOpts, err error)
func ResourceManager ¶ added in v0.13.0
func ResourceManager(cfg config.SwarmConfig) func(fx.Lifecycle, repo.Repo) (network.ResourceManager, Libp2pOpts, error)
func Security ¶
func Security(enabled bool, tptConfig config.Transports) interface{}
func SetupDiscovery ¶
func SmuxTransport ¶
func SmuxTransport(tptConfig config.Transports) func() (opts Libp2pOpts, err error)
func TopicDiscovery ¶ added in v0.5.0
func TopicDiscovery() interface{}
func Transports ¶ added in v0.6.0
func Transports(tptConfig config.Transports) interface{}
Types ¶
type AddrInfoChan ¶ added in v0.13.0
type BaseIpfsRouting ¶
type HostOption ¶
type HostOption func(id peer.ID, ps peerstore.Peerstore, options ...libp2p.Option) (host.Host, error)
var DefaultHostOption HostOption = constructPeerHost
type Libp2pOpts ¶
func BandwidthCounter ¶
func BandwidthCounter() (opts Libp2pOpts, reporter *metrics.BandwidthCounter)
func MultiaddrResolver ¶ added in v0.9.0
func MultiaddrResolver(rslv *madns.Resolver) (opts Libp2pOpts, err error)
type NetStatOut ¶ added in v0.13.0
type NetStatOut struct { System *network.ScopeStat `json:",omitempty"` Transient *network.ScopeStat `json:",omitempty"` Services map[string]network.ScopeStat `json:",omitempty"` Protocols map[string]network.ScopeStat `json:",omitempty"` Peers map[string]network.ScopeStat `json:",omitempty"` }
func NetStat ¶ added in v0.13.0
func NetStat(mgr network.ResourceManager, scope string) (NetStatOut, error)
type P2PHostOut ¶
func Host ¶
func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (out P2PHostOut, err error)
type PNetFingerprint ¶
type PNetFingerprint []byte
Click to show internal directories.
Click to hide internal directories.