transportp2p

package
v0.0.0-...-0721423 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Protocol = "/rns/one-way/0.0.1"

Protocol defines a libp2p protocol ID that can be used by clients and servers to identify the p2p remote-netstack transport.

Variables

This section is empty.

Functions

func MakeTestHost

func MakeTestHost(listenPort int) (host.Host, error)

MakeTestHost creates a LibP2P host with a random peer ID listening on the given multi address for use in tests.

Types

type Config

type Config struct {
	Logger *zap.Logger
}

type Option

type Option func(*Config)

Option is a function that knows how to customize the Config struct.

func WithLogger

func WithLogger(logger *zap.Logger) Option

type Transport

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

Transport is a p2p transport based on libp2p that uses a netstack endpoint as the data link layer.

func New

func New(h host.Host, ep *channel.Endpoint, opts ...Option) (*Transport, error)

New creates a new p2p transport using the given channel endpoint as the source of data sent over the transport.

Jump to

Keyboard shortcuts

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