Skip to content

Commit

Permalink
ETCM-168: Add kademlia-alpha to config.
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Nov 3, 2020
1 parent 03116dd commit a806e7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ mantis {
# Timeout to collect all possible responses for a FindNode request.
kademlia-timeout = 7.seconds

# Level of concurrency during lookups and enrollment.
kademlia-alpha = 3

# Maximum number of messages in the queue associated with a UDP channel.
channel-capacity = 100
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ case class DiscoveryConfig(
requestTimeout: FiniteDuration,
kademliaTimeout: FiniteDuration,
kademliaBucketSize: Int,
kademliaAlpha: Int,
channelCapacity: Int
)

Expand All @@ -36,6 +37,7 @@ object DiscoveryConfig {
requestTimeout = discoveryConfig.getDuration("request-timeout").toMillis.millis,
kademliaTimeout = discoveryConfig.getDuration("kademlia-timeout").toMillis.millis,
kademliaBucketSize = discoveryConfig.getInt("kademlia-bucket-size"),
kademliaAlpha = discoveryConfig.getInt("kademlia-alpha"),
channelCapacity = discoveryConfig.getInt("channel-capacity")
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ object PeerDiscoveryManager extends LazyLogger {
requestTimeout = discoveryConfig.requestTimeout,
kademliaTimeout = discoveryConfig.kademliaTimeout,
kademliaBucketSize = discoveryConfig.kademliaBucketSize,
kademliaAlpha = discoveryConfig.kademliaAlpha,
// Discovery is going to enroll with all the bootstrap nodes.
// In theory we could pass the known nodes as well which Mantis
// persisted, but that could be a lot more, leading to prolonged
Expand Down

0 comments on commit a806e7c

Please sign in to comment.