mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-30 16:01:59 +00:00
chore: update deps test: fix usage of latest switch test: change ping self test as its not supported anymore chore: use package.files instead of .npmignore
1.3 KiB
1.3 KiB
libp2p-ping JavaScript Implementation
IPFS ping protocol JavaScript implementation
Lead Maintainer
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()