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

Conversation

vasco-santos
Copy link
Contributor

No description provided.

SPEC/DHT.md Outdated
Where `peerId` is a IPFS/libp2p Id from [PeerId](https://github.com/libp2p/js-peer-id) type.

`callback` must follow `function (err, res) {}` signature, where `err` is an error if the operation was not successful. `res` is an object containing `responses` as an array of peer responses. In this case, as we are looking for a particular peer, there will be only one response. This response is composed by the peerId, as well as an array with its adresses.
`callback` must follow `function (err, peerInfos) {}` signature, where `err` is an error if the operation was not successful. `peerInfos` is an array of type `[PeerInfo]`. In this case, as we are looking for a particular peer, there will be only one entry. This entry is composed by the peerId, as well as its adresses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there will be only one entry

If there is always one entry shall we return just the peerInfo instance?

ipfs.dht.findProvs(multihash, function (err, res) {})

ipfs.dht.findprovs(multihash, { timeout: 4000 }, function (err, res) {})
ipfs.dht.findProvs(multihash, { timeout: 4000 }, function (err, res) {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeout => maxTimeout? ...or just stick with timeout ;)

SPEC/DHT.md Outdated

`options` an optional object with the following properties
- `timeout` - a maximum timeout in milliseconds
- `maxTimeout` - a maximum timeout in milliseconds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO just timeout is a better name

@alanshaw alanshaw merged commit 3500961 into master Dec 10, 2018
@alanshaw alanshaw deleted the fix/dht-responses branch December 10, 2018 18:26
@ghost ghost removed the in progress label Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants