Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ETCM-196: DiscoveryConfig to hold misc settings.
- Loading branch information
Showing
3 changed files
with
69 additions
and
41 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
scalanet/discovery/src/io/iohk/scalanet/discovery/ethereum/v4/DiscoveryConfig.scala
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,23 @@ | ||
package io.iohk.scalanet.discovery.ethereum.v4 | ||
|
||
import scala.concurrent.duration._ | ||
|
||
case class DiscoveryConfig( | ||
// How long in the future to set message expiration. | ||
messageExpiration: FiniteDuration, | ||
// Timeout for individual requests. | ||
requestTimeout: FiniteDuration, | ||
// Timeout for collecting multiple potential Neighbors responses. | ||
kademliaTimeout: FiniteDuration, | ||
// Max number of neighbours to expect. | ||
kademliaBucketSize: Int | ||
) | ||
|
||
object DiscoveryConfig { | ||
val default = DiscoveryConfig( | ||
messageExpiration = 60.seconds, | ||
requestTimeout = 3.seconds, | ||
kademliaTimeout = 7.seconds, | ||
kademliaBucketSize = 16 | ||
) | ||
} |
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