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

refactor: return peer ids as strings#1226

Merged
achingbrain merged 8 commits intomasterfrom
return-peer-ids-as-strings
Jan 31, 2020
Merged

refactor: return peer ids as strings#1226
achingbrain merged 8 commits intomasterfrom
return-peer-ids-as-strings

Conversation

@achingbrain
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Please add BREAKING CHANGE message.

@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