libp2p

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultKeySize = 2048

Variables

This section is empty.

Functions

func ConnectToPeer added in v0.3.26

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

func ConnectToPeersContinuously

func ConnectToPeersContinuously(ctx context.Context, cm *system.CleanupManager, h host.Host, peers []multiaddr.Multiaddr) error

func ConnectToPeersContinuouslyWithRetryDuration added in v0.3.24

func ConnectToPeersContinuouslyWithRetryDuration(
	ctx context.Context,
	cm *system.CleanupManager,
	h host.Host,
	peers []multiaddr.Multiaddr,
	tickDuration time.Duration,
) error

func GeneratePrivateKey added in v1.0.4

func GeneratePrivateKey(numBits int) (crypto.PrivKey, error)

func NewHost

func NewHost(port int, privKey crypto.PrivKey, opts ...libp2p.Option) (host.Host, error)

NewHost creates a new libp2p host with some default configuration. It will continuously connect to bootstrap peers if they are defined.

func NewHostForTest

func NewHostForTest(ctx context.Context, peers ...host.Host) (host.Host, error)

Types

type PeerInfoDecorator added in v1.2.1

type PeerInfoDecorator struct {
	// contains filtered or unexported fields
}

func NewPeerInfoDecorator added in v1.2.1

func NewPeerInfoDecorator(params PeerInfoDecoratorParams) *PeerInfoDecorator

func (*PeerInfoDecorator) DecorateNodeInfo added in v1.2.1

func (l *PeerInfoDecorator) DecorateNodeInfo(ctx context.Context, nodeInfo models.NodeInfo) models.NodeInfo

type PeerInfoDecoratorParams added in v1.2.1

type PeerInfoDecoratorParams struct {
	Host            host.Host
	IdentityService identify.IDService
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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