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

Commit

Permalink
feat(dht): add dht.get spec
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias authored and victorb committed Nov 8, 2016
1 parent 9878a92 commit 9ec3064
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions API/dht/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,32 @@ 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
})
ipfs.dht.findProvs(hash, function (err, peerInfos) {})
```

#### `get`

>
> Retrieve a value from DHT
##### `Go` **WIP**

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

Where `key` is a string.

`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.

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

Example:

```JavaScript
ipfs.dht.get(key, function (err, value) {})
```

#### `put`

>
> Store a value on the DHT
##### `Go` **WIP**

Expand Down

0 comments on commit 9ec3064

Please sign in to comment.