This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned vasco-santos
Dec 10, 2018
ghost
added
the
in progress
label
Dec 10, 2018
2 tasks
vasco-santos
force-pushed
the
fix/dht-responses
branch
from
December 10, 2018 16:08
4a48726
to
19a0c6e
Compare
vasco-santos
force-pushed
the
fix/dht-responses
branch
from
December 10, 2018 16:35
19a0c6e
to
934e9db
Compare
35 tasks
alanshaw
suggested changes
Dec 10, 2018
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. |
There was a problem hiding this comment.
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, { timeout: 4000 }, function (err, res) {}) | ||
ipfs.dht.findProvs(multihash, { timeout: 4000 }, function (err, res) {}) |
There was a problem hiding this comment.
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
|
||
Where `hash` is a multihash. | ||
|
||
`options` an optional object with the following properties | ||
- `timeout` - a maximum timeout in milliseconds | ||
- `maxTimeout` - a maximum timeout in milliseconds |
There was a problem hiding this comment.
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
approved these changes
Dec 10, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.