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

Add Networking Layer materials to /developers/docs #5838

Merged
merged 33 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9ac5380
initial commit: network landing pg & net addr page
jmcook1186 Mar 29, 2022
4ed547b
finish draft network-addr page
jmcook1186 Mar 29, 2022
7544e75
add formatting for eth.org
jmcook1186 Mar 29, 2022
55f4ae8
rename file to index.md
jmcook1186 Mar 29, 2022
f7fceee
update menus
jmcook1186 Mar 30, 2022
53ed215
fix page links and page-dev-index links
jmcook1186 Mar 30, 2022
1fb4e46
fix image links (html ->markdown)
jmcook1186 Mar 30, 2022
64d75fd
remove redundant image
jmcook1186 Mar 30, 2022
20b2950
fix page section links
jmcook1186 Mar 30, 2022
a9f7f92
rm notes accidentally committed & + to gitignore
jmcook1186 Mar 31, 2022
add5f43
update img link
jmcook1186 Mar 31, 2022
fe7a497
Update src/content/developers/docs/networking-layer/network-addresses…
jmcook1186 Apr 5, 2022
a68156f
Update src/content/developers/docs/networking-layer/network-addresses…
jmcook1186 Apr 5, 2022
cdc9548
Update src/content/developers/docs/networking-layer/network-addresses…
jmcook1186 Apr 5, 2022
59e2af7
Update src/content/developers/docs/networking-layer/network-addresses…
jmcook1186 Apr 5, 2022
7e410dd
Update src/content/developers/docs/networking-layer/index.md
jmcook1186 Apr 5, 2022
8c18b86
udpate according to @minimalsm review comments
jmcook1186 Apr 5, 2022
bf4c407
DevP2P info to DevP2P section, move link
jmcook1186 Apr 5, 2022
27cf522
update according to @minimalsm comments
jmcook1186 Apr 13, 2022
a142f55
Update index.md
jmcook1186 Apr 13, 2022
b088307
Update src/content/developers/docs/networking-layer/network-addresses…
jmcook1186 Apr 13, 2022
0776144
Update src/content/developers/docs/networking-layer/index.md
jmcook1186 Apr 13, 2022
afc103f
Update index.md
jmcook1186 Apr 13, 2022
5f47efc
2nd lev el heading -> 3rd level heading
jmcook1186 Apr 13, 2022
1fd8aa3
add to intro paragraph
jmcook1186 May 10, 2022
96de76b
Apply suggestions from code review
jmcook1186 May 10, 2022
6ea6f53
fix ip addr
jmcook1186 May 10, 2022
25445b0
mention engine api
jmcook1186 May 10, 2022
8ed6495
Update src/content/developers/docs/networking-layer/index.md
jmcook1186 May 10, 2022
cbc1e9e
update page link
jmcook1186 May 10, 2022
92f8a74
Merge branch 'network-layer' of https://github.com/jmcook1186/ethereu…
jmcook1186 May 10, 2022
ac610be
fix ip address typo
jmcook1186 May 16, 2022
b7cb0a8
Merge branch 'dev' into network-layer
minimalsm May 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 156 additions & 0 deletions src/content/developers/docs/networking-layer/index.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Network addresses
description: An introduction to network addresses.
lang: en
sidebar: true
sidebarDepth: 2
---

Ethereum nodes have to identify themselves with some basic information so that they can connect to peers. To ensure this information can be interpreted by any potential peer it is relayed in one of three standardized formats that any Ethereum node can understand: multiaddr, enode and Ethereum Node Records.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites {#prerequisites}

Some understanding of Ethereum's [networking layer](/src/content/developers/docs/networking-layer/) will be helpful to understand this page.

## Multiaddr {#multiaddr}

The original network address format was the "multiaddr". This is a universal format not only designed for Ethereum nodes but other peer-to-peer networks too. Addresses are represented as key-value pairs with keys and values separated with a forward slash, e.g. the multiaddr for a node with IPv4 address `192.168.22.27` listening to TCP port `33000` looks like:
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

`/ip6/192.168.22.27/tcp/33000`
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

For an Ethereum node, the multiaddr has the node-ID (hash of their public key), for example:
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

`/ip6/192.168.22.27/tcp/33000/p2p/5t7Nv7dG2d6ffbvAiewVsEwWweU3LdebSqX2y1bPrW8br`
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

## Enode {#enode}

An ethereum node can also be described using the enode URL scheme. The hexadecimal node-ID is encoded in the username portion of the URLseparated from the host using an @ sign. The hostname can only be given as an IP address, DNS nammes are not allowed. The port in the host name section is the TCP listening port. If the TCP and UDP (discovery) ports differ the UDP port is specified as a query parameter "discport".
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

In the following example, the node URL describes a node with IP address `10.3.58`, TCP port `30303` and UDP discovery port `30301`.
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

`enode://6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0@10.3.58.6:30303?discport=30301`

## Ethereum Node Records (ENRs) {#enr}

Ethereum Node Records (ENRs) are a standardized format for network addresses on Ethereum. They supercede multiaddresses and enodes. These are especially useful because they allow greater informational exchange between nodes. The ENR contains a signature, sequence number and fields detailing the identity scheme used to generate and validate signatures. The rest of the record can be populated with arbitrary data organised as key-value pairs. These key-value pairs contain the node's IP address and information about the sub-protocols the node is able to use. Consensus clients use a [specific ENR structure](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#enr-structure) to identify boot nodes and also include an `eth2` field containing information about the current Ethereum fork and the attestation gossip subnet (this connects the node to a particular set of peers whose attestations are aggregated together).
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved

## Further Reading {#further-reading}

[ENR EIP](https://eips.ethereum.org/EIPS/eip-778)
jmcook1186 marked this conversation as resolved.
Show resolved Hide resolved
[Network addresses in Ethereum](https://dean.eigenmann.me/blog/2020/01/21/network-addresses-in-ethereum/)
[LibP2P: Multiaddr-Enode-ENR?!](https://consensys.net/diligence/blog/2020/09/libp2p-multiaddr-enode-enr/)
6 changes: 6 additions & 0 deletions src/data/developer-docs-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,9 @@
to: /developers/docs/scaling/plasma/
- id: docs-nav-scaling-validium
to: /developers/docs/scaling/validium/
- id: docs-nav-networking-layer
to: /developers/docs/networking-layer/
description: docs-nav-networking-layer-description
items:
- id: docs-nav-networking-layer-network-addresses
to: /developers/docs/networking-layer/network-addresses/
3 changes: 3 additions & 0 deletions src/intl/en/page-developers-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
"docs-nav-transactions-description": "Transfers and other actions that cause Ethereum's state to change",
"docs-nav-web2-vs-web3": "Web2 vs Web3",
"docs-nav-web2-vs-web3-description": "The fundamental differences that blockchain-based applications provide",
"docs-nav-networking-layer": "Networking layer",
"docs-nav-networking-layer-description": "Explanation of Ethereum's networking layer",
"docs-nav-networking-layer-network-addresses": "Network addresses",
"page-calltocontribute-desc-1": "If you're an expert on the topic and want to contribute, edit this page and sprinkle it with your wisdom.",
"page-calltocontribute-desc-2": "You'll be credited and you'll be helping the Ethereum community!",
"page-calltocontribute-desc-3": "Use this flexible",
Expand Down
5 changes: 4 additions & 1 deletion src/intl/en/page-developers-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@
"page-developers-transactions-desc": "The way Ethereum state changes",
"page-developers-transactions-link": "Transactions",
"page-developers-web3-desc": "How the web3 world of development is different",
"page-developers-web3-link": "Web2 vs Web3"
"page-developers-web3-link": "Web2 vs Web3",
"page-developers-networking-layer": "Networking Layer",
"page-developers-networking-layer-link": "Networking Layer",
"page-developers-networking-layer-desc": "Introduction to the Ethereum networking layer"
}
7 changes: 7 additions & 0 deletions src/pages/developers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ const DevelopersPage = ({ data }) => {
<p>
<Translation id="page-developers-scaling-desc" />
</p>

<Link to="/developers/docs/networking-layer/">
<Translation id="page-developers-networking-layer-link" />
</Link>
<p>
<Translation id="page-developers-networking-layer-desc" />
</p>
</RightColumn>
</ThreeColumnContent>
</GrayContainer>
Expand Down