Skip to content

Commit d82d9d5

Browse files
committed
docs: some fixes on discv4 docs
1 parent ff59089 commit d82d9d5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

crates/net/discv4/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# <h1 align="center"> discv4 </h1>
22

33
This is a rust implementation of
4-
the [Discovery v4](https://github.com/ethereum/devp2p/blob/40ab248bf7e017e83cc9812a4e048446709623e8/discv4.md)
4+
the [Discovery v4](https://github.com/ethereum/devp2p/blob/0b3b679be294324eb893340461c7c51fb4c15864/discv4.md)
55
peer discovery protocol.
66

77
For comparison to Discovery v5,
@@ -14,7 +14,7 @@ This is inspired by the [discv5](https://github.com/sigp/discv5) crate and reuse
1414
The discovery service continuously attempts to connect to other nodes on the network until it has found enough peers.
1515
If UPnP (Universal Plug and Play) is supported by the router the service is running on, it will also accept connections
1616
from external nodes. In the discovery protocol, nodes exchange information about where the node can be reached to
17-
eventually establish ``RLPx`` sessions.
17+
eventually establish `RLPx` sessions.
1818

1919
## Trouble Shooting
2020

crates/net/discv4/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,11 @@ impl Discv4 {
213213
/// Binds a new `UdpSocket` and creates the service
214214
///
215215
/// ```
216-
/// # use std::io;
217216
/// use reth_discv4::{Discv4, Discv4Config};
218217
/// use reth_network_peers::{pk2id, NodeRecord, PeerId};
219218
/// use secp256k1::SECP256K1;
220219
/// use std::{net::SocketAddr, str::FromStr};
221-
/// # async fn t() -> io::Result<()> {
220+
///
222221
/// // generate a (random) keypair
223222
/// let (secret_key, pk) = SECP256K1.generate_keypair(&mut rand_08::thread_rng());
224223
/// let id = pk2id(&pk);
@@ -237,9 +236,6 @@ impl Discv4 {
237236
///
238237
/// // lookup the local node in the DHT
239238
/// let _discovered = discv4.lookup_self().await.unwrap();
240-
///
241-
/// # Ok(())
242-
/// # }
243239
/// ```
244240
pub async fn bind(
245241
local_address: SocketAddr,
@@ -2109,7 +2105,7 @@ impl Default for LookupTargetRotator {
21092105
}
21102106

21112107
impl LookupTargetRotator {
2112-
/// this will return the next node id to lookup
2108+
/// This will return the next node id to lookup
21132109
fn next(&mut self, local: &PeerId) -> PeerId {
21142110
self.counter += 1;
21152111
self.counter %= self.interval;

0 commit comments

Comments
 (0)