Documentation ¶
Index ¶
- Variables
- func AddrFilters(filters []string) func() (opts Libp2pOpts, err error)
- func AddrsFactory(announce []string, noAnnounce []string) func() (opts Libp2pOpts, err error)
- func AutoNATService(quic bool) ...
- func BaseRouting(lc fx.Lifecycle, in BaseIpfsRouting) (out p2pRouterOut, dr *dht.IpfsDHT)
- 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 GossipSub(pubsubOptions ...pubsub.Option) interface{}
- 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
- 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)
- func Relay(disable, enableHop bool) func() (opts Libp2pOpts, err error)
- func Routing(in p2pOnlineRoutingIn) routing.IpfsRouting
- func Security(enabled, preferTLS bool) interface{}
- func SetupDiscovery(mdns bool, mdnsInterval int) func(helpers.MetricsCtx, fx.Lifecycle, host.Host, *discoveryHandler) error
- func SmuxTransport(mplex bool) func() (opts Libp2pOpts, err error)
- func StartListening(addresses []string) func(host host.Host) error
- type BaseIpfsRouting
- type HostOption
- type Libp2pOpts
- type P2PHostIn
- type P2PHostOut
- type PNetFingerprint
- type Router
- type RoutingOption
Constants ¶
This section is empty.
Variables ¶
View Source
var AutoRealy = simpleOpt(libp2p.ChainOptions(libp2p.EnableAutoRelay(), libp2p.DefaultStaticRelays()))
View Source
var DefaultTransports = simpleOpt(libp2p.DefaultTransports)
View Source
var NatPortMap = simpleOpt(libp2p.NATPortMap())
View Source
var QUIC = simpleOpt(libp2p.Transport(libp2pquic.NewTransport))
Functions ¶
func AddrFilters ¶
func AddrFilters(filters []string) func() (opts Libp2pOpts, err error)
func AddrsFactory ¶
func AddrsFactory(announce []string, noAnnounce []string) func() (opts Libp2pOpts, err error)
func AutoNATService ¶
func BaseRouting ¶
func BaseRouting(lc fx.Lifecycle, in BaseIpfsRouting) (out p2pRouterOut, dr *dht.IpfsDHT)
func ConnectionManager ¶
func ConnectionManager(low, high int, grace time.Duration) func() (opts Libp2pOpts, err error)
func DiscoveryHandler ¶
func DiscoveryHandler(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host) *discoveryHandler
func PNet ¶
func PNet(repo repo.Repo) (opts Libp2pOpts, fp PNetFingerprint, err error)
func PstoreAddSelfKeys ¶
func PstoreAddSelfKeys(id peer.ID, sk crypto.PrivKey, ps peerstore.Peerstore) error
func PubsubRouter ¶
func PubsubRouter(mctx helpers.MetricsCtx, lc fx.Lifecycle, in p2pPSRoutingIn) (p2pRouterOut, *namesys.PubsubValueStore)
func Relay ¶
func Relay(disable, enableHop bool) func() (opts Libp2pOpts, err error)
func Routing ¶
func Routing(in p2pOnlineRoutingIn) routing.IpfsRouting
func SetupDiscovery ¶
func SmuxTransport ¶
func SmuxTransport(mplex bool) func() (opts Libp2pOpts, err error)
Types ¶
type BaseIpfsRouting ¶
type BaseIpfsRouting routing.IpfsRouting
type HostOption ¶
type HostOption func(ctx context.Context, 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.Reporter)
type P2PHostOut ¶
type P2PHostOut struct { fx.Out Host host.Host Routing BaseIpfsRouting }
func Host ¶
func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (out P2PHostOut, err error)
type PNetFingerprint ¶
type PNetFingerprint []byte
type Router ¶
type Router struct { routing.IpfsRouting Priority int // less = more important }
type RoutingOption ¶
type RoutingOption func(context.Context, host.Host, datastore.Batching, record.Validator) (routing.IpfsRouting, error)
var DHTClientOption RoutingOption = constructClientDHTRouting
var DHTOption RoutingOption = constructDHTRouting
var NilRouterOption RoutingOption = nilrouting.ConstructNilRouting
Click to show internal directories.
Click to hide internal directories.