Skip to content

libp2p/js-libp2p-daemon-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libp2p-daemon client JavaScript implementation

Discourse posts

A Javascript client to interact with a standalone deployment of a libp2p host, running in its own OS process. Essentially, this client allows to communicate with other peers, interact with the DHT, participate in pubsub, etc. no matter the language they are implemented with.

Lead Maintainer

Vasco Santos

Table of Contents

Specs

The specs for the daemon are currently housed in the go implementation. You can read them at libp2p/go-libp2p-daemon

Install

npm install libp2p-daemon-client

Usage

Run a daemon process

There are currently two implementations of the libp2p-daemon:

Interact with the daemon process using the client

const Client = require('libp2p-daemon-client')

const defaultSock = '/tmp/p2pd.sock'
const client = new Client(defaultSock)

// interact with the daemon
let identify
try {
  identify = await client.identify()
} catch (err) {
  // ...
}

// close the socket
await client.close()

API

Contribute

This module is actively under development. Please check out the issues and submit PRs!

License

MIT © Protocol Labs