Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

example of using peers, #253

Open
benoitc opened this issue Feb 6, 2020 · 3 comments
Open

example of using peers, #253

benoitc opened this issue Feb 6, 2020 · 3 comments

Comments

@benoitc
Copy link

benoitc commented Feb 6, 2020

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?

@madninja
Copy link
Member

madninja commented Feb 6, 2020

What spec are you referring to?

@benoitc
Copy link
Author

benoitc commented Feb 6, 2020 via email

@madninja
Copy link
Member

madninja commented Feb 6, 2020

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.

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

No branches or pull requests

2 participants