ipfs

package
v0.0.0-...-b7c645d Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const Rendezvous string = "/msuite/node"

Variables

View Source
var FilesModule = fx.Provide(fx.Annotate(NewNode, fx.ParamTags(``, `name:"mainHost"`, ``, ``)))
View Source
var Libp2pOptionsExtra = []libp2p.Option{
	libp2p.NATPortMap(),
	libp2p.ConnectionManager(func() *connmgr.BasicConnMgr {
		connMgr, _ := connmgr.NewConnManager(100, 500, connmgr.WithGracePeriod(time.Minute))
		return connMgr
	}()),
	libp2p.EnableAutoRelay(),
	libp2p.EnableNATService(),
	libp2p.Security(libp2ptls.ID, libp2ptls.New),
}
View Source
var P2PModule = fx.Options(
	fx.Provide(Identity),
	fx.Provide(fx.Annotate(Libp2p, fx.ResultTags(`name:"mainHost"`, ``, ``))),
	fx.Provide(fx.Annotate(LocalDialer, fx.ResultTags(`name:"localDialer"`))),
	fx.Provide(fx.Annotate(Pubsub, fx.ParamTags(``, `name:"mainHost"`))),
	fx.Provide(NewSvcDiscovery),
	fx.Invoke(fx.Annotate(NewMDNSDiscovery, fx.ParamTags(``, `name:"mainHost"`))),
	fx.Invoke(fx.Annotate(NewP2PReporter, fx.ParamTags(`name:"mainHost"`, ``))),
	fx.Invoke(fx.Annotate(Bootstrapper, fx.ParamTags(``, ``, ``, `name:"mainHost"`))),
)

Functions

func Bootstrapper

func Bootstrapper(
	lc fx.Lifecycle,
	cfg config.Config,
	tm *taskmanager.TaskManager,
	h host.Host,
) error

func Identity

func Identity(conf config.Config) (crypto.PrivKey, error)

func Libp2p

func Libp2p(
	ctx context.Context,
	lc fx.Lifecycle,
	conf config.Config,
	priv crypto.PrivKey,
) (host.Host, routing.Routing, error)

func LocalDialer

func LocalDialer(
	lc fx.Lifecycle,
) (host.Host, error)

func NewMDNSDiscovery

func NewMDNSDiscovery(ctx context.Context, h host.Host) error

func NewNode

func NewNode(
	ctx context.Context,
	h host.Host,
	dht routing.Routing,
	rootDS datastore.Batching,
) (*ipfslite.Peer, error)

func NewP2PReporter

func NewP2PReporter(h host.Host, st status.Manager)

func NewSvcDiscovery

func NewSvcDiscovery(r routing.Routing) discovery.Discovery

func Pubsub

func Pubsub(ctx context.Context, h host.Host) (*pubsub.PubSub, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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