libp2p ping implementation
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ci
src
test
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
appveyor.yml
circle.yml
package.json

README.md

libp2p-ping JavaScript Implementation

Coverage Status Dependency Status Travis CI Circle CI

IPFS ping protocol JavaScript implementation

Lead Maintainer

Vasco Santos.

Usage

var Ping = require('libp2p-ping')

Ping.mount(swarm) // Enable this peer to echo Ping requests

var p = new Ping(swarm, peerDst) // Ping peerDst, peerDst must be a peer-info object

p.on('ping', function (time) {
  console.log(time + 'ms')
  p.stop() // stop sending pings
})

p.start()