Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using one p2pd from multiple processes #204

Closed
4 tasks
justheuristic opened this issue Apr 2, 2021 · 1 comment
Closed
4 tasks

Using one p2pd from multiple processes #204

justheuristic opened this issue Apr 2, 2021 · 1 comment
Assignees
Labels
averaging enhancement New feature or request

Comments

@justheuristic
Copy link
Member

(libp2p branch)

As of right now, hivemind.P2P runs and controls a p2pd instance and accepts all incoming requests in a single process. However, a typical hivemind peer will run multiple processes that all require p2p communication.

Can you please research:

  • is it possible to connect multiple pythonic clients to the same P2Pd?
  • if it is, how do they process different protocols? For instance, if client1 handles protocol 'a' and client2 handles 'b', will p2pd route incoming calls with protocol 'a' to client1 and 'b' to client2?
    • what happens if multiple clients attempt to listen to the the same protocol?
  • if multiple clients can co-exist, can they be created in different processes?
@MaximKsh
Copy link
Collaborator

MaximKsh commented Apr 3, 2021

My little investigation

p2pd stores inside itself mapping protocol -> binding maddr. When request comes to p2pd, p2pd lookups binding that can handle request and opens connection to binding. After that p2pd is just a bridge between external node and python binding.
So,

  1. Two different python bindings can connect to p2pd simultaneously
  2. Two different python bindings can register handlers of different protocols and don't affect each other
  3. If two different python bindings register handler of same protocol then only last will receive incoming connections

PS. Two different python bindings == two different processes

MaximKsh pushed a commit that referenced this issue Apr 3, 2021
MaximKsh pushed a commit that referenced this issue Apr 7, 2021
MaximKsh added a commit that referenced this issue Apr 7, 2021
* #204 P2P replica mode

* #204 rename replica->replicate
@MaximKsh MaximKsh closed this as completed Apr 7, 2021
@MaximKsh MaximKsh moved this from In progress to Done in Training from behind NAT & firewalls Apr 7, 2021
justheuristic pushed a commit that referenced this issue Apr 13, 2021
* #204 P2P replica mode

* #204 rename replica->replicate
MaximKsh added a commit that referenced this issue Apr 20, 2021
* #204 P2P replica mode

* #204 rename replica->replicate
MaximKsh added a commit that referenced this issue May 14, 2021
* #204 P2P replica mode

* #204 rename replica->replicate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
averaging enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants