github.com/KYVENetwork/cometbft/v38@v38.0.3/spec/p2p/README.md (about)

     1  ---
     2  order: 1
     3  parent:
     4    title: P2P
     5    order: 6
     6  ---
     7  
     8  # Peer-to-Peer Communication
     9  
    10  A CometBFT network is composed of multiple CometBFT instances, hereafter called
    11  `nodes`, that interact by exchanging messages.
    12  
    13  The CometBFT protocols are designed under the assumption of a partially-connected network model.
    14  This means that a node is not assumed to be directly connected to every other
    15  node in the network.
    16  Instead, each node is directly connected to only a subset of other nodes,
    17  hereafter called its `peers`.
    18  
    19  The peer-to-peer (p2p) communication layer is then the component of CometBFT that:
    20  
    21  1. establishes connections between nodes in a CometBFT network
    22  2. manages the communication between a node and the connected peers
    23  3. intermediates the exchange of messages between peers in CometBFT protocols
    24  
    25  The specification the p2p layer is a work in progress,
    26  tracked by [issue #19](https://github.com/KYVENetwork/cometbft/v38/issues/19).
    27  The current content is organized as follows:
    28  
    29  - [`implementation`](./implementation/README.md): documents the current state
    30    of the implementation of the p2p layer, covering the main components of the
    31    `p2p` package. The documentation covers, in a fairly comprehensive way,
    32     the items 1. and 2. from the list above.
    33  - [`reactor-api`](./reactor-api/README.md): specifies the API offered by the
    34    p2p layer to the protocol layer, through the `Reactor` abstraction.
    35    This is a high-level specification (i.e., it should not be implementation-specific)
    36    of the p2p layer API, covering item 3. from the list above.
    37  - [`legacy-docs`](./legacy-docs/): We keep older documentation in
    38    the `legacy-docs` directory, as overall, it contains useful information.
    39    However, part of this content is redundant,
    40    being more comprehensively covered in more recent documents,
    41    and some implementation details might be outdated
    42    (see [issue #981](https://github.com/KYVENetwork/cometbft/v38/issues/981)).
    43  
    44  In addition to this content, some unfinished, work in progress, and auxiliary
    45  material can be found in the
    46  [knowledge-base](https://github.com/cometbft/knowledge-base/tree/main/p2p) repository.