I am learning how the Tezos peer-to-peer network works. I understood the basic design where the maintenance worker will keep connecting to the known points from p2p_pool. According to the documentation, when there are not enough points in the pool, the peer discovery worker will be triggered.

How does this help? What does this peer discovery do? Isn't that it only advertises the identities of our nodes to our peers?

Additional to this, can someone please enlighten me on how a point (IP + port) is considered as a known point?



Known points are points who are know to run a Tezos node (or at least, they are good candidates). They are maintained by the P2p_module. They can be specified when launching a node on the command-line / config file, hard-coded in the node, discovered on the local network, or advertised by other peers using the P2p protocol.

The worker that tries to establish new connections is defined in modulee P2p_maintenance. When the number of connections is out of the bound specified by the user, the worker will try to establish connections to the know points

The P2p_discovery module creates a worker that tries to find points located on the same local network (using UDP broadcast). It's useful for instance when running a local network in sandbox mode, but is not essential. It mostly saves you from specifying points when launching the node.

You can look at these modules documentation for more details.

| improve this answer | |
  • Can you explain what is the local network? How many peers we can expect to get from peer discovery if it queries only points on the same local network? Known points can certainly come from other peers' advertisements using P2P protocol, but I couldn't locate the code where known points are added via this method. It would be great if you can give me some pointers to this method. – Muoi Tran Jan 22 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.