From 818e2d14f933bf222e9c42af0414b5c70f0465b8 Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 9 Aug 2016 08:28:21 +0100 Subject: [PATCH] feat(dht): add dht.findprovs spec --- API/dht/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/API/dht/README.md b/API/dht/README.md index 1853acdd..e716d1bb 100644 --- a/API/dht/README.md +++ b/API/dht/README.md @@ -32,11 +32,19 @@ ipfs.dht.findPeer(id, function (err, peerInfo) { ##### `JavaScript` - ipfs.dht.findprovs(hash, [callback]) +Where `hash` is a multihash. + +`callback` must follow `function (err, peerInfos) {}` signature, where `err` is an error if the operation was not successful. `peerInfos` is an array of objects of type [PeerInfo](https://github.com/libp2p/js-peer-info) + If no `callback` is passed, a promise is returned. Example: - +```JavaScript +ipfs.dht.findProvs(hash, function (err, peerInfos) { + // peerInfo will contain the multiaddrs of that peer +}) +``` #### `get`