p2pd

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0, MIT Imports: 32 Imported by: 3

README

[!WARNING]

🚧 This repository is no longer maintained 🚧

This project may still be used in legacy tests but is not safe for use in production due to security issues and lack of active maintenance.

For modern libp2p examples, including how to build your own daemons and services, see: https://github.com/libp2p/go-libp2p/tree/master/examples

libp2p Daemon

GoDoc Discourse posts

A standalone deployment of a libp2p host, running in its own OS process and installing a set of virtual endpoints to enable co-local applications to: communicate with peers, handle protocols, interact with the DHT, participate in pubsub, etc. no matter the language they are developed in, nor whether a native libp2p implementation exists in that language.

Install

This repo uses Go modules. Note that go >=1.12 is required.

$ # outside your GOPATH
$ git clone https://github.com/libp2p/go-libp2p-daemon
$ cd go-libp2p-daemon
$ git checkout <release tag, e.g. v0.0.1>
$ go get ./...
$ go install ./...
$ p2pd

See available releases.

Usage

Check out the GoDocs.

Language Bindings

Daemon bindings enable applications written in other languages to interact with the libp2p daemon process programmatically, by exposing an idiomatic API that handles the socket dynamics and control protocol.

The following bindings exist so far (if you want yours added, please send a PR):

If you wish to implement bindings in a new language, refer to the spec for the daemon control protocol and API.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT


The last gx published version of this module was: 0.0.20: QmVBYP5AGurRJGiyTcyoUf5Etyvf2vwxKd8DMaQgbpJF58

Documentation

Index

Constants

View Source
const BootstrapConnections = 4
View Source
const DefaultTimeout = 60 * time.Second

Variables

View Source
var BootstrapPeers = dht.DefaultBootstrapPeers

Functions

func ReadIdentity

func ReadIdentity(path string) (crypto.PrivKey, error)

func UserAgent added in v0.9.2

func UserAgent() string

UserAgent returns the dynamically generated user agent string.

func WriteIdentity

func WriteIdentity(k crypto.PrivKey, path string) error

Types

type Daemon

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

func NewDaemon

func NewDaemon(ctx context.Context, maddr ma.Multiaddr, dhtMode string, opts ...libp2p.Option) (*Daemon, error)

func (*Daemon) Addrs

func (d *Daemon) Addrs() []ma.Multiaddr

func (*Daemon) Bootstrap

func (d *Daemon) Bootstrap() error

func (*Daemon) Close added in v0.1.0

func (d *Daemon) Close() error

func (*Daemon) DHTRoutingFactory

func (d *Daemon) DHTRoutingFactory(opts []dhtopts.Option) func(host.Host) (routing.PeerRouting, error)

func (*Daemon) EnableEcho added in v0.6.1

func (d *Daemon) EnableEcho() error

func (*Daemon) EnablePubsub

func (d *Daemon) EnablePubsub(router string, sign, strict bool) error

func (*Daemon) EnableRelayV2 added in v0.4.0

func (d *Daemon) EnableRelayV2() error

func (*Daemon) ID

func (d *Daemon) ID() peer.ID

func (*Daemon) Listener

func (d *Daemon) Listener() manet.Listener

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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