-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
52 lines (43 loc) · 1.36 KB
/
config.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
45
46
47
48
49
50
51
52
package kowalad
const (
// config defaults
MaxPeers = 15
MaxPendingPeers = 5
NetworkID = 1
DataDir = "kowala-oracle"
LiteEnabled = true
LiteDatabaseCache = 16
)
// Config represents the backend config
type Config struct {
// MaxPeers is the maximum number of peers that can be connected.
Maxpeers int // needs to be int for compability reasons
// MaxPendingPeers represents the maximum pending peers that a node has at a time.
MaxPendingPeers int // needs to be int for compability reasons
// NetworkID is the network that the node will join
NetworkID uint64
// DataDir is the default data directory for the oracle executable
DataDir string
// LightService represents kowala light protocol configuration
LightService ProtocolConfig
}
// ProtocolConfig contains the light client protocol related config
type ProtocolConfig struct {
// Enabled specifies whether the protocol is enabled
Enabled bool
// DatabaseCache internal caching (min 16MB)
DatabaseCache uint64
}
// NewConfig returns a new configuration, initialized with the default/foundation values
func NewConfig() *Config {
return &Config{
Maxpeers: MaxPeers,
MaxPendingPeers: MaxPendingPeers,
NetworkID: NetworkID,
DataDir: DataDir,
LightService: ProtocolConfig{
Enabled: LiteEnabled,
DatabaseCache: LiteDatabaseCache,
},
}
}