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

Commit 9ec3064

Browse files
daviddiasvictorb
authored andcommitted
feat(dht): add dht.get spec
1 parent 9878a92 commit 9ec3064

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Diff for: API/dht/README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,32 @@ If no `callback` is passed, a promise is returned.
4141
Example:
4242

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

4947
#### `get`
5048

51-
>
49+
> Retrieve a value from DHT
5250
5351
##### `Go` **WIP**
5452

5553
##### `JavaScript` - ipfs.dht.get(key, [callback])
5654

55+
Where `key` is a string.
56+
57+
`callback` must follow `function (err, value) {}` signature, where `err` is an error if the operation was not successful. `value` is the value that was stored under that key.
5758

5859
If no `callback` is passed, a promise is returned.
5960

6061
Example:
6162

63+
```JavaScript
64+
ipfs.dht.get(key, function (err, value) {})
65+
```
6266

6367
#### `put`
6468

65-
>
69+
> Store a value on the DHT
6670
6771
##### `Go` **WIP**
6872

0 commit comments

Comments
 (0)