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

swarm.peers() doesn't return a Promise #317

Closed
haadcode opened this issue Jul 7, 2016 · 1 comment
Closed

swarm.peers() doesn't return a Promise #317

haadcode opened this issue Jul 7, 2016 · 1 comment
Labels

Comments

@haadcode
Copy link
Contributor

haadcode commented Jul 7, 2016

At some point the swarm commands were re-implemented and in the process, their return type was changed from Promise to callback. This breaks the use of js-ipfs-api in older projects.

Furthermore, the APIs return different data: on js-ipfs-api, it's { Strings: [<addresses>] } and on js-ipfs it's an array of Multiaddresses.

@daviddias
Copy link
Contributor

It now returns a promise (see: https://github.com/ipfs/js-ipfs-api/blob/master/src/api/swarm.js#L8)

And we are making the API compatible through interface-ipfs-core, we just need to get the pull-streams in and change the libp2p to support multiaddrs without ipfs ids too. Follow here:

ipfs/js-ipfs#439 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants