-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathprofiles.go
31 lines (28 loc) · 1.04 KB
/
profiles.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package config
func applyLowPowerProfile(cfg *Config) {
cfg.P2P.MaxInboundPeers = LowPowerMaxInboundNotOwnShardPeers
cfg.P2P.MaxOutboundPeers = LowPowerMaxOutboundNotOwnShardPeers
cfg.P2P.MaxInboundOwnShardPeers = LowPowerMaxInboundOwnShardPeers
cfg.P2P.MaxOutboundOwnShardPeers = LowPowerMaxOutboundOwnShardPeers
cfg.IpfsConf.LowWater = 8
cfg.IpfsConf.HighWater = 10
cfg.IpfsConf.GracePeriod = "30s"
cfg.IpfsConf.ReproviderInterval = "0"
cfg.IpfsConf.Routing = "dhtclient"
}
func applySharedNodeProfile(cfg *Config) {
cfg.P2P.Multishard = true
cfg.Sync.LoadAllFlips = true
cfg.IpfsConf.LowWater = 50
cfg.IpfsConf.HighWater = 100
}
func applyDefaultProfile(cfg *Config) {
cfg.P2P.MaxInboundPeers = DefaultMaxInboundNotOwnShardPeers
cfg.P2P.MaxOutboundPeers = DefaultMaxOutboundNotOwnShardPeers
cfg.P2P.MaxInboundOwnShardPeers = DefaultMaxInboundOwnShardPeers
cfg.P2P.MaxOutboundOwnShardPeers = DefaultMaxOutboundOwnShardPeers
cfg.IpfsConf.LowWater = 30
cfg.IpfsConf.HighWater = 50
cfg.P2P.Multishard = false
cfg.Sync.LoadAllFlips = false
}