-
Notifications
You must be signed in to change notification settings - Fork 12
chore/remove-peer-info-from-api #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Just FYI there are issues with the latest http client being worked on in #23. Builds should be fine here once that's merged. |
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.
Another issue is the timeout, for some reason the string you are sending isnt working. To work around this just send the timeout as a number in ms
you also need the stuff in the PR jacob mentioned for remote nodes |
d925627
to
266a5f4
Compare
updated ipfsd-ctl docs to better explain the setup |
b1af5e2
to
be62fa2
Compare
BREAKING CHANGE: findPeer returns id and addrs properties instead of peer-info instance
be62fa2
to
60137d2
Compare
README.md
Outdated
@@ -17,9 +17,9 @@ const DelegatedPeerRouting = require('libp2p-delegated-peer-routing') | |||
const routing = new DelegatedPeerRouing() | |||
|
|||
try { | |||
const peerInfo = await routing.findPeer('peerid') | |||
const { id, addresses } = await routing.findPeer('peerid') |
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.
This will fail, needs to be addrs
.
Also, I realized this is different than the peer discovery api. Perhaps we should make peer routing consistent with peer discovery and do { id, multiaddrs }
? https://github.com/libp2p/js-libp2p-interfaces/tree/v0.3.x/src/peer-discovery#discoverying-peers
const { id, addresses } = await routing.findPeer('peerid') | |
const { id, addrs } = await routing.findPeer('peerid') |
src/index.js
Outdated
@@ -36,25 +35,28 @@ class DelegatedPeerRouting { | |||
* @param {PeerID} id | |||
* @param {object} options | |||
* @param {number} options.timeout How long the query can take. Defaults to 30 seconds | |||
* @returns {Promise<PeerInfo>} | |||
* @returns {Promise<{ id: PeerId, addrs: Multiaddr[] }>} |
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.
Per above, make this { id, multiaddrs }
?
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.
LGTM
Beta release is out dist-tags:
beta: 0.5.0 latest: 0.4.3 |
In the context of deprecating
peer-info
as described on libp2p/js-libp2p#589, this PR removes thepeer-info
from being returned in the API, in favour of returning{ id, addrs }
in the same way as ipfs does.BREAKING CHANGE: findPeer returns id and addrs properties instead of peer-info instance
Needs: