erlang-libp2p icon indicating copy to clipboard operation
erlang-libp2p copied to clipboard

example of using peers,

Open benoitc opened this issue 5 years ago • 3 comments

my understanding when reading the libo2p spec is that peerid can be used to manage users per nodes (each user has a key). How to create and add multiple peer ids / nodes? do you have any example for it?

benoitc avatar Feb 06 '20 12:02 benoitc

What spec are you referring to?

madninja avatar Feb 06 '20 13:02 madninja

https://docs.libp2p.io/concepts/peer-id/ https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md

i may not understand what is a peer id in this case though. basically i would like to be able tro manage an object that has its own key pair that be be use to open private channels to exchanges messages between them.

On Thu 6 Feb 2020 at 14:09 Marc Nijdam [email protected] wrote:

What spec are you referring to?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/helium/erlang-libp2p/issues/253?email_source=notifications&email_token=AAADRISD6H4R3YOMM3IRLNDRBQDZTA5CNFSM4KQ4HGT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK7FELY#issuecomment-582898223, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADRIWHHIMRFZPL66J7PX3RBQDZTANCNFSM4KQ4HGTQ .

-- Sent from my Mobile

benoitc avatar Feb 06 '20 13:02 benoitc

basically a swarm is a peer.. Each swarm has it's own key pair and it's p2p address is /p2p/<b58pubkey>.

If you want to address "objects" in a swarm you use streams to address them inside that swarm. The dial function does that by taking a p2p address of a swarm and a "path" to the object (really a stream) you want to communicate with.

madninja avatar Feb 06 '20 16:02 madninja