Documentation ¶
Index ¶
- Constants
- Variables
- func AddrFilters(filters []string) func() (opts Libp2pOpts, err error)
- func AddrsFactory(announce []string, noAnnounce []string) func() (opts Libp2pOpts, err error)
- func BaseRouting(lc fx.Lifecycle, in BaseIpfsRouting) (out p2pRouterOut, dr *dht.IpfsDHT)
- func ConnectionManager(low, high uint, grace time.Duration, protected []string) func() (opts Libp2pOpts, err error)
- func DHTRouting(mode dht.ModeOpt) interface{}
- func Discovery(router BaseIpfsRouting) (coredisc.Discovery, error)
- func DiscoveryHandler(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host) *discoveryHandler
- func GossipSub(in GossipIn) (service *pubsub.PubSub, err error)
- func HashMsgId(m *pubsub_pb.Message) string
- func NoRelay() func() (opts Libp2pOpts, err error)
- func PrivKey(ks types.KeyStore) (crypto.PrivKey, error)
- func PstoreAddSelfKeys(id peer.ID, sk crypto.PrivKey, ps peerstore.Peerstore) error
- func RoutedHost(rh RawHost, r BaseIpfsRouting) host.Host
- func Routing(in p2pOnlineRoutingIn) routing.Routing
- func ScoreKeeper() *dtypes.ScoreKeeper
- func Security(enabled, preferTLS bool) interface{}
- func SmuxTransport(mplex bool) func() (opts Libp2pOpts, err error)
- func StartListening(addresses []string) func(host host.Host) error
- type BaseIpfsRouting
- type GossipIn
- type Libp2pOpts
- type P2PHostIn
- type RawHost
- type Router
Constants ¶
View Source
const ( KLibp2pHost = "libp2p-host" KTLibp2pHost = KLibp2pHost )
Variables ¶
View Source
var AutoNATService = simpleOpt(libp2p.EnableNATService())
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 BaseRouting ¶
func BaseRouting(lc fx.Lifecycle, in BaseIpfsRouting) (out p2pRouterOut, dr *dht.IpfsDHT)
func ConnectionManager ¶
func DHTRouting ¶
func Discovery ¶
func Discovery(router BaseIpfsRouting) (coredisc.Discovery, error)
TODO: should be use baseRouting or can we use higher level router here?
func DiscoveryHandler ¶
func NoRelay ¶ added in v0.3.1
func NoRelay() func() (opts Libp2pOpts, err error)
func PstoreAddSelfKeys ¶
func RoutedHost ¶
func RoutedHost(rh RawHost, r BaseIpfsRouting) host.Host
func ScoreKeeper ¶ added in v0.3.1
func ScoreKeeper() *dtypes.ScoreKeeper
func SmuxTransport ¶
func SmuxTransport(mplex bool) func() (opts Libp2pOpts, err error)
Types ¶
type BaseIpfsRouting ¶
func NilRouting ¶
func NilRouting(mctx helpers.MetricsCtx) (BaseIpfsRouting, error)
type GossipIn ¶ added in v0.4.0
type GossipIn struct { fx.In Mctx helpers.MetricsCtx Lc fx.Lifecycle Host host.Host Nn dtypes.NetworkName Bp dtypes.BootstrapPeers Db dtypes.DrandBootstrap Cfg *config.Pubsub Sk *dtypes.ScoreKeeper Dr dtypes.DrandConfig }
type Libp2pOpts ¶
func BandwidthCounter ¶
func BandwidthCounter() (opts Libp2pOpts, reporter metrics.Reporter)
Click to show internal directories.
Click to hide internal directories.