-
Notifications
You must be signed in to change notification settings - Fork 50
/
ipfs.go
44 lines (40 loc) · 1.05 KB
/
ipfs.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
32
33
34
35
36
37
38
39
40
41
42
43
44
package config
import "time"
type IpfsConfig struct {
DataDir string
BootNodes []string
IpfsPort int
StaticPort bool
SwarmKey string
Routing string
LowWater int
HighWater int
GracePeriod string
ReproviderInterval string
Profile string
BlockPinThreshold float32
FlipPinThreshold float32
PublishPeers bool
Gc IpfsGcConfig
}
type IpfsGcConfig struct {
Enabled bool
Interval time.Duration
Timeout time.Duration
IntervalBeforeValidation time.Duration
NotificationDelay time.Duration
}
func GetDefaultIpfsConfig() *IpfsConfig {
return &IpfsConfig{
BlockPinThreshold: 0.3,
FlipPinThreshold: 0.5,
Profile: "server",
Gc: IpfsGcConfig{
Enabled: true,
Interval: time.Hour * 24,
Timeout: time.Minute * 10,
IntervalBeforeValidation: time.Hour * 12,
NotificationDelay: time.Minute,
},
}
}