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.
The specs for the daemon are currently housed in the go implementation. You can read them at libp2p/go-libp2p-daemon
npm install libp2p-daemon-client
There are currently two implementations of the libp2p-daemon
:
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()
- Getting started
close
connect
identify
listPeers
openStream
registerStream
dht.put
dht.get
dht.findPeer
dht.provide
dht.findProviders
dht.getClosestPeers
dht.getPublicKey
This module is actively under development. Please check out the issues and submit PRs!
MIT © Protocol Labs