forked from cometbft/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spec/p2p: new structure for the p2p specification (cometbft#966)
* spec/p2p: moving legacy documents to legacy/ dir * spec/p2p: using capitalized names for README.md * spec/p2p: intro to p2p spec, moved from other README * spec/p2p: v0.34.x documentation, README shortened * spec/p2p: minor changes on READMEs * spec/p2p: moving messages/ content to legacy/ dir * spec/p2p: dir for docs of the p2p implementation * spec/p2p: renamed reactor dirs to reactor-api * spec/p2p: legacy content to legacy-docs/ dir * spec/p2p: fixes on implementation/README.md file * spec/p2p: moving images to a single subdir * spec/p2p: fixing Markdown links * spec/p2p: fixing Markdown links in all repo * spec/p2p: table of contents for the p2p docs * spec/p2p: applying suggestions from Josef Co-authored-by: Josef Widder <[email protected]> --------- Co-authored-by: Josef Widder <[email protected]>
- Loading branch information
1 parent
f4301af
commit b66bcbb
Showing
34 changed files
with
142 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
order: 1 | ||
parent: | ||
title: P2P | ||
order: 6 | ||
--- | ||
|
||
# Peer-to-Peer Communication | ||
|
||
A CometBFT network is composed of multiple CometBFT instances, hereafter called | ||
`nodes`, that interact by exchanging messages. | ||
|
||
The CometBFT protocols are designed under the assumption of a partially-connected network model. | ||
This means that a node is not assumed to be directly connected to every other | ||
node in the network. | ||
Instead, each node is directly connected to only a subset of other nodes, | ||
hereafter called its `peers`. | ||
|
||
The peer-to-peer (p2p) communication layer is then the component of CometBFT that: | ||
|
||
1. establishes connections between nodes in a CometBFT network | ||
2. manages the communication between a node and the connected peers | ||
3. intermediates the exchange of messages between peers in CometBFT protocols | ||
|
||
The specification the p2p layer is a work in progress, | ||
tracked by [issue #19](https://github.com/cometbft/cometbft/issues/19). | ||
The current content is organized as follows: | ||
|
||
- [`implementation`](./implementation/README.md): documents the current state | ||
of the implementation of the p2p layer, covering the main components of the | ||
`p2p` package. The documentation covers, in a fairly comprehensive way, | ||
the items 1. and 2. from the list above. | ||
- [`reactor-api`](./reactor-api/README.md): specifies the API offered by the | ||
p2p layer to the protocol layer, through the `Reactor` abstraction. | ||
This is a high-level specification (i.e., it should not be implementation-specific) | ||
of the p2p layer API, covering item 3. from the list above. | ||
- [`legacy-docs`](./legacy-docs/): We keep older documentation in | ||
the `legacy-docs` directory, as overall, it contains useful information. | ||
However, part of this content is redundant, | ||
being more comprehensively covered in more recent documents, | ||
and some implementation details might be outdated | ||
(see [issue #981](https://github.com/cometbft/cometbft/issues/981)). | ||
|
||
In addition to this content, some unfinished, work in progress, and auxiliary | ||
material can be found in the | ||
[knowledge-base](https://github.com/cometbft/knowledge-base/tree/main/p2p) repository. |
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Implementation of the p2p layer | ||
|
||
This section documents the implementation of the peer-to-peer (p2p) | ||
communication layer in CometBFT. | ||
|
||
The documentation was [produced](https://github.com/tendermint/tendermint/pull/9348) | ||
using the `v0.34.*` releases | ||
and the branch [`v0.34.x`](https://github.com/cometbft/cometbft/tree/v0.34.x) | ||
of this repository as reference. | ||
As there were no substancial changes in the p2p implementation, the | ||
documentation also applies to the releases `v0.37.*` and `v0.38.*` [^v35]. | ||
|
||
[^v35]: The releases `v0.35.*` and `v0.36.*`, which included a major | ||
refactoring of the p2p layer implementation, were [discontinued][v35postmorten]. | ||
|
||
[v35postmorten]: https://interchain-io.medium.com/discontinuing-tendermint-v0-35-a-postmortem-on-the-new-networking-layer-3696c811dabc | ||
|
||
## Contents | ||
|
||
The documentation follows the organization of the | ||
[`p2p` package](https://github.com/cometbft/cometbft/tree/v0.34.x/p2p), | ||
which implements the following abstractions: | ||
|
||
- [Transport](./transport.md): establishes secure and authenticated | ||
connections with peers; | ||
- [Switch](./switch.md): responsible for dialing peers and accepting | ||
connections from peers, for managing established connections, and for | ||
routing messages between the reactors and peers, | ||
that is, between local and remote instances of the CometBFT protocols; | ||
- [PEX Reactor](./pex.md): due to the several roles of this component, the | ||
documentation is split in several parts: | ||
- [Peer Exchange protocol](./pex-protocol.md): enables nodes to exchange peer addresses, thus implementing a peer discovery service; | ||
- [Address Book](./addressbook.md): stores discovered peer addresses and | ||
quality metrics associated to peers with which the node has interacted; | ||
- [Peer Manager](./peer_manager.md): defines when and to which peers a node | ||
should dial, in order to establish outbound connections; | ||
- [Types](./types.md) and [Configuration](./configuration.md) provide a list of | ||
existing types and configuration parameters used by the p2p package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.