go-ipfs: github.com/ipfs/go-ipfs/core/node/libp2p Index | Files

package libp2p

import "github.com/ipfs/go-ipfs/core/node/libp2p"

Index

Package Files

addrs.go discovery.go host.go hostopt.go libp2p.go nat.go peerstore.go pnet.go pubsub.go relay.go routing.go routingopt.go smux.go transport.go

Variables

var AutoRelay = simpleOpt(libp2p.EnableAutoRelay())
var DefaultTransports = simpleOpt(libp2p.DefaultTransports)
var NatPortMap = simpleOpt(libp2p.NATPortMap())
var QUIC = simpleOpt(libp2p.Transport(libp2pquic.NewTransport))
var UserAgent = simpleOpt(libp2p.UserAgent(version.UserAgent))

func AddrFilters Uses

func AddrFilters(filters []string) func() (opts Libp2pOpts, err error)

func AddrsFactory Uses

func AddrsFactory(announce []string, noAnnounce []string) func() (opts Libp2pOpts, err error)

func AutoNATService Uses

func AutoNATService(quic bool) func(repo repo.Repo, mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host) error

func BaseRouting Uses

func BaseRouting(lc fx.Lifecycle, in BaseIpfsRouting) (out p2pRouterOut, dr *dht.IpfsDHT)

func ConnectionManager Uses

func ConnectionManager(low, high int, grace time.Duration) func() (opts Libp2pOpts, err error)

func DiscoveryHandler Uses

func DiscoveryHandler(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host) *discoveryHandler

func FloodSub Uses

func FloodSub(pubsubOptions ...pubsub.Option) interface{}

func GossipSub Uses

func GossipSub(pubsubOptions ...pubsub.Option) interface{}

func PNet Uses

func PNet(repo repo.Repo) (opts Libp2pOpts, fp PNetFingerprint, err error)

func PNetChecker Uses

func PNetChecker(repo repo.Repo, ph host.Host, lc fx.Lifecycle) error

func Peerstore Uses

func Peerstore(lc fx.Lifecycle) peerstore.Peerstore

func PstoreAddSelfKeys Uses

func PstoreAddSelfKeys(id peer.ID, sk crypto.PrivKey, ps peerstore.Peerstore) error

func PubsubRouter Uses

func PubsubRouter(mctx helpers.MetricsCtx, lc fx.Lifecycle, in p2pPSRoutingIn) (p2pRouterOut, *namesys.PubsubValueStore)

func Relay Uses

func Relay(disable, enableHop bool) func() (opts Libp2pOpts, err error)

func Routing Uses

func Routing(in p2pOnlineRoutingIn) routing.Routing

func Security Uses

func Security(enabled, preferTLS bool) interface{}

func SetupDiscovery Uses

func SetupDiscovery(mdns bool, mdnsInterval int) func(helpers.MetricsCtx, fx.Lifecycle, host.Host, *discoveryHandler) error

func SmuxTransport Uses

func SmuxTransport(mplex bool) func() (opts Libp2pOpts, err error)

func StartListening Uses

func StartListening(addresses []string) func(host host.Host) error

type BaseIpfsRouting Uses

type BaseIpfsRouting routing.Routing

type HostOption Uses

type HostOption func(ctx context.Context, id peer.ID, ps peerstore.Peerstore, options ...libp2p.Option) (host.Host, error)
var DefaultHostOption HostOption = constructPeerHost

type Libp2pOpts Uses

type Libp2pOpts struct {
    fx.Out

    Opts []libp2p.Option `group:"libp2p"`
}

func BandwidthCounter Uses

func BandwidthCounter() (opts Libp2pOpts, reporter metrics.Reporter)

type P2PHostIn Uses

type P2PHostIn struct {
    fx.In

    Repo          repo.Repo
    Validator     record.Validator
    HostOption    HostOption
    RoutingOption RoutingOption
    ID            peer.ID
    Peerstore     peerstore.Peerstore

    Opts [][]libp2p.Option `group:"libp2p"`
}

type P2PHostOut Uses

type P2PHostOut struct {
    fx.Out

    Host    host.Host
    Routing BaseIpfsRouting
}

func Host Uses

func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (out P2PHostOut, err error)

type PNetFingerprint Uses

type PNetFingerprint []byte

type Router Uses

type Router struct {
    routing.Routing

    Priority int // less = more important
}

type RoutingOption Uses

type RoutingOption func(context.Context, host.Host, datastore.Batching, record.Validator) (routing.Routing, error)
var DHTClientOption RoutingOption = constructClientDHTRouting
var DHTOption RoutingOption = constructDHTRouting
var NilRouterOption RoutingOption = nilrouting.ConstructNilRouting

Package libp2p imports 44 packages (graph) and is imported by 16 packages. Updated 2019-10-02. Refresh now. Tools for package owners.