libp2p

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

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

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳