libp2p

package
v0.0.0-...-105113c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FloodSubID = protocol.ID("/dropfloodsub/1.0.0")
)

Variables

View Source
var LibP2PDefaultOpts = fx.Options(
	OptsOut(libp2p.DefaultTransports),
	OptsOut(libp2p.NATPortMap()),
	OptsOut(libp2p.EnableAutoRelay()),
	OptsOut(libp2p.EnableNATService()),
	OptsOut(libp2p.Security(libp2ptls.ID, libp2ptls.New)),
	OptsOut(libp2p.Security(secio.ID, secio.New)),
)

Functions

func ErrorOptOut

func ErrorOptOut(val string) fx.Option

func FloodSub

func FloodSub() fx.Option

func NewHost

func NewHost(
	lc fx.Lifecycle,
	ds datastore.Batching,
	optsList Libp2pOptsIn,
) (host.Host, routing.Routing, error)

func OptsOut

func OptsOut(opt libp2p.Option) fx.Option

Types

type BwOut

type BwOut struct {
	fx.Out

	Opts     libp2p.Option `group:"libp2p_opts"`
	Reporter *metrics.BandwidthCounter
}

func BandwidthReporter

func BandwidthReporter() BwOut

type ID

type ID struct {
	PeerID  string
	PrivKey string `json:",omitempty"`
}

type Libp2pOptsIn

type Libp2pOptsIn struct {
	fx.In

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

type Libp2pOptsOut

type Libp2pOptsOut struct {
	fx.Out

	Opts libp2p.Option `group:"libp2p_opts"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL