Pregunta

I'm working on my first P2P app using C# core and gRPC and I'm finding it difficult to understand the concepts of how nodes find each other and build a routing table.

For my design I'd like to only have nodes and no listener/directory/discovery servers.

I'll have a list of a few "known nodes" that can start off the chain of finding and connecting to peers but can't figure out a workflow for it.

Questions:

1) How are ID's assigned to each node?

2) How does peer discovery work?

- Known node is running and is the only node on the network.
- New node connects to known node and requests full peer list?
- Connect to each peer on the list?

3) Since each node is a client and a server, does there needs to be 2 connections between each node?

¿Fue útil?

Solución

You have to know someone to get in the club.

When you download p2p software it has a list of known stable peers. So long as one of them is up it'll give you the latest list of peers. Baring that you can always start your own p2p network by distributing a connection string to your friends.

There's plenty of complexity you can add to that to load balance and such but this is essentially how peers find peers. The software jump starts it and after that it's word of mouth.

Well, unless you go around port scanning. But that's a bit rude.

Licenciado bajo: CC-BY-SA con atribución
scroll top