Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 9878a92

Browse files
daviddiasvictorb
authored andcommitted
feat(dht): add dht.findprovs spec
1 parent daf892d commit 9878a92

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

API/dht/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@ ipfs.dht.findPeer(id, function (err, peerInfo) {
3232

3333
##### `JavaScript` - ipfs.dht.findprovs(hash, [callback])
3434

35+
Where `hash` is a multihash.
36+
37+
`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)
38+
3539
If no `callback` is passed, a promise is returned.
3640

3741
Example:
3842

39-
43+
```JavaScript
44+
ipfs.dht.findProvs(hash, function (err, peerInfos) {
45+
// peerInfo will contain the multiaddrs of that peer
46+
})
47+
```
4048

4149
#### `get`
4250

0 commit comments

Comments
 (0)