File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
# <h1 align =" center " > discv4 </h1 >
2
2
3
3
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 )
5
5
peer discovery protocol.
6
6
7
7
For comparison to Discovery v5,
@@ -14,7 +14,7 @@ This is inspired by the [discv5](https://github.com/sigp/discv5) crate and reuse
14
14
The discovery service continuously attempts to connect to other nodes on the network until it has found enough peers.
15
15
If UPnP (Universal Plug and Play) is supported by the router the service is running on, it will also accept connections
16
16
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.
18
18
19
19
## Trouble Shooting
20
20
Original file line number Diff line number Diff line change @@ -213,12 +213,11 @@ impl Discv4 {
213
213
/// Binds a new `UdpSocket` and creates the service
214
214
///
215
215
/// ```
216
- /// # use std::io;
217
216
/// use reth_discv4::{Discv4, Discv4Config};
218
217
/// use reth_network_peers::{pk2id, NodeRecord, PeerId};
219
218
/// use secp256k1::SECP256K1;
220
219
/// use std::{net::SocketAddr, str::FromStr};
221
- /// # async fn t() -> io::Result<()> {
220
+ ///
222
221
/// // generate a (random) keypair
223
222
/// let (secret_key, pk) = SECP256K1.generate_keypair(&mut rand_08::thread_rng());
224
223
/// let id = pk2id(&pk);
@@ -237,9 +236,6 @@ impl Discv4 {
237
236
///
238
237
/// // lookup the local node in the DHT
239
238
/// let _discovered = discv4.lookup_self().await.unwrap();
240
- ///
241
- /// # Ok(())
242
- /// # }
243
239
/// ```
244
240
pub async fn bind (
245
241
local_address : SocketAddr ,
@@ -2109,7 +2105,7 @@ impl Default for LookupTargetRotator {
2109
2105
}
2110
2106
2111
2107
impl LookupTargetRotator {
2112
- /// this will return the next node id to lookup
2108
+ /// This will return the next node id to lookup
2113
2109
fn next ( & mut self , local : & PeerId ) -> PeerId {
2114
2110
self . counter += 1 ;
2115
2111
self . counter %= self . interval ;
You can’t perform that action at this time.
0 commit comments