mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-05-11 22:09:32 +00:00
Add autonat conf
This commit is contained in:
parent
cf2f40f559
commit
24c1515778
@ -52,6 +52,8 @@ export
|
||||
DefaultQuotaBytes, DefaultBlockTtl, DefaultBlockInterval, DefaultNumBlocksPerInterval,
|
||||
DefaultBlockRetries
|
||||
|
||||
const DefaultNatScheduleInterval* = 5.minutes
|
||||
|
||||
type ThreadCount* = distinct Natural
|
||||
|
||||
proc `==`*(a, b: ThreadCount): bool {.borrow.}
|
||||
@ -286,6 +288,31 @@ type
|
||||
desc: "Logs to file", defaultValue: string.none, name: "log-file", hidden
|
||||
.}: Option[string]
|
||||
|
||||
natScheduleInterval* {.
|
||||
desc: "Interval between AutoNAT reachability checks",
|
||||
defaultValue: DefaultNatScheduleInterval,
|
||||
defaultValueDesc: $DefaultNatScheduleInterval,
|
||||
name: "nat-schedule-interval"
|
||||
.}: Duration
|
||||
|
||||
natNumPeersToAsk* {.
|
||||
desc: "Number of peers to ask per AutoNAT round",
|
||||
defaultValue: 3,
|
||||
name: "nat-num-peers-to-ask"
|
||||
.}: int
|
||||
|
||||
natMaxQueueSize* {.
|
||||
desc: "Number of past AutoNAT results kept to calculate confidence",
|
||||
defaultValue: 3,
|
||||
name: "nat-max-queue-size"
|
||||
.}: int
|
||||
|
||||
natMinConfidence* {.
|
||||
desc: "Minimum confidence threshold to confirm reachability",
|
||||
defaultValue: 0.7,
|
||||
name: "nat-min-confidence"
|
||||
.}: float
|
||||
|
||||
func defaultAddress*(conf: StorageConf): IpAddress =
|
||||
result = static parseIpAddress("127.0.0.1")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user