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

refactor: return peer ids as strings #1226

Merged
merged 8 commits into from
Jan 31, 2020
Merged

Conversation

achingbrain
Copy link
Collaborator

@achingbrain achingbrain commented Jan 24, 2020

BREAKING CHANGE:

Where PeerIDs were previously CIDs, now they are Strings

  • ipfs.bitswap.stat().peers[n] is now a String (was a CID)
  • ipfs.dht.findPeer().id is now a String (was a CID)
  • ipfs.dht.findProvs()[n].id is now a String (was a CID)
  • ipfs.dht.provide()[n].id is now a String (was a CID)
  • ipfs.dht.put()[n].id is now a String (was a CID)
  • ipfs.dht.query()[n].id is now a String (was a CID)
  • ipfs.id().id is now a String (was a CID)
  • ipfs.id().addresses[n] are now Multiaddrs (were Strings)

Depends on:

@alanshaw
Copy link
Contributor

Please add BREAKING CHANGE message.

src/bitswap/stat.js Show resolved Hide resolved
src/dht/find-peer.js Show resolved Hide resolved
src/dht/find-provs.js Show resolved Hide resolved
src/dht/provide.js Show resolved Hide resolved
src/dht/put.js Show resolved Hide resolved
src/dht/query.js Show resolved Hide resolved
src/id.js Show resolved Hide resolved
src/swarm/addrs.js Show resolved Hide resolved
@achingbrain achingbrain merged commit 2a9d765 into master Jan 31, 2020
@achingbrain achingbrain deleted the return-peer-ids-as-strings branch January 31, 2020 12:46
alanshaw pushed a commit to ipfs/js-ipfs that referenced this pull request Feb 3, 2020
Also updates all examples to use the new API.

Depends on:

- [x] ipfs-inactive/interface-js-ipfs-core#581
- [x] ipfs-inactive/js-ipfs-http-client#1226
- [x] libp2p/js-libp2p#545

BREAKING CHANGE:

Where `PeerID`s were previously [CID](https://www.npmjs.com/package/cids)s, now they are Strings

- `ipfs.bitswap.stat().peers[n]` is now a String (was a CID)
- `ipfs.dht.findPeer().id` is now a String (was a CID)
- `ipfs.dht.findProvs()[n].id` is now a String (was a CID)
- `ipfs.dht.provide()[n].id` is now a String (was a CID)
- `ipfs.dht.put()[n].id` is now a String (was a CID)
- `ipfs.dht.query()[n].id` is now a String (was a CID)
- `ipfs.id().id` is now a String (was a CID)
- `ipfs.id().addresses[n]` are now [Multiaddr](https://www.npmjs.com/package/multiaddr)s (were Strings)
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