Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

feat: simpler peer id #117

Merged
merged 7 commits into from
Jan 1, 2022
Merged

feat: simpler peer id #117

merged 7 commits into from
Jan 1, 2022

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Dec 14, 2021

Refactors PeerIds with the aim of making them easier to use in places like API clients where you generally don't do any cryptographic operations.

Splits the existing peer-id functionality into libp2p-peer-id for everyday activities like turning strings/byte arrays into PeerIds, and libp2p-peer-id-factory for generating new keypairs and creating PeerIds from them, also creating them from protobuf bytes, json objects, and other esoteric formats.

Depending on use of those formats we may move the methods into libp2p-peer-id in future but it's a reasonable start.

Tries to remove some of the duplication in parsing PeerIDs out of strings, and also tries to not create lots of CID objects when trying to parse PeerIDs out of byte arrays.

There's a lot of noise in this PR, maybe the place to start is:

Refactors `PeerId`s with the aim of making them easier to use in places
like API clients where you generally don't do any cryptographic operations.

Splits the existing `peer-id` functionality into `libp2p-peer-id` for everyday
activities like turning strings/byte arrays into `PeerId`s, and `libp2p-peer-id-factory`
for generating new keypairs and creating `PeerId`s from them, also creating
them from protobuf bytes, json objects, and other esoteric formats.

Depending on use of those formats we may move the methods into `libp2p-peer-id`
in future but it's a reasonable start.
@achingbrain achingbrain merged commit fa2c4f5 into master Jan 1, 2022
@achingbrain achingbrain deleted the feat/simpler-peer-id branch January 1, 2022 07:24
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/interfaces-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/peer-id-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/topology-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/peer-id-factory-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/connection-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/pubsub-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

1 participant