ezlibp2p

package module
v0.0.0-...-17c7ded Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 18 Imported by: 0

README

ezlibp2p - easy libp2p

PkgGoDev

Quality of life and common functionality for go-libp2p.

Have you ever felt that for every single project that uses libp2p you had to reimplement the same functionality over and over again? Well, me too... ezlibp2p implements this common functionality.

Most notably:

  • bootstrapping
  • auto autorelay finding
  • persistent identity
  • writing/reading protobuf messages
  • mdns

Project Status

This library must NOT be considered stable. I will definitely stabilize it one day but for that to happen I must gain more experience with how to handle go-libp2p.

I am using ezlibp2 in all of my projects that use libp2p, every now and then I find a better solution than the one present in ezlibp2p, and then I slightly change the API of ezlibp2p to account for that.

Contributing

All contributions are welcome! I have nothing more to say than to respect others and use GitHub features.

If you would like to submit a pull request, before doing any work create an issue and I will reach out to you so we can discuss it.

Thanks for sticking around, stay curious! Best,
Wiktor

Documentation

Index

Constants

View Source
const DEFAULT_ID_FILE_NAME = "libp2p_id"

Variables

View Source
var ErrToManyBootstrapNodesErrored = errors.New("To many bootstrap nodes errored.")

Functions

func Bootstrap

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

func EnableAutoRelay

func EnableAutoRelay(futureHost *host.Host) libp2p.Option

func InitMdns

func InitMdns(host host.Host) error

func InitMdnsNotifee

func InitMdnsNotifee(host host.Host, Notifee mdns.Notifee) error

func NewPeerstoreRelayPeerSource

func NewPeerstoreRelayPeerSource(futureHost *host.Host) func(ctx context.Context, numPeers int) <-chan peer.AddrInfo

func NewRoutingC

func NewRoutingC(ctx context.Context) config.RoutingC

func PersistentIdentity

func PersistentIdentity() (libp2p.Option, error)

func PersistentIdentityFilePath

func PersistentIdentityFilePath(filePath string) (libp2p.Option, error)

func Routing

func Routing(ctx context.Context) libp2p.Option

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