-
Notifications
You must be signed in to change notification settings - Fork 77
/
application_config.go
53 lines (50 loc) · 2.35 KB
/
application_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
53
package config
import (
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
)
// ApplicationConfiguration config specific to the node.
type ApplicationConfiguration struct {
Address string `yaml:"Address"`
AnnouncedNodePort uint16 `yaml:"AnnouncedPort"`
AttemptConnPeers int `yaml:"AttemptConnPeers"`
DBConfiguration dbconfig.DBConfiguration `yaml:"DBConfiguration"`
DialTimeout int64 `yaml:"DialTimeout"`
LogPath string `yaml:"LogPath"`
MaxPeers int `yaml:"MaxPeers"`
MinPeers int `yaml:"MinPeers"`
NodePort uint16 `yaml:"NodePort"`
PingInterval int64 `yaml:"PingInterval"`
PingTimeout int64 `yaml:"PingTimeout"`
Pprof BasicService `yaml:"Pprof"`
Prometheus BasicService `yaml:"Prometheus"`
ProtoTickInterval int64 `yaml:"ProtoTickInterval"`
Relay bool `yaml:"Relay"`
RPC RPC `yaml:"RPC"`
UnlockWallet Wallet `yaml:"UnlockWallet"`
Oracle OracleConfiguration `yaml:"Oracle"`
P2PNotary P2PNotary `yaml:"P2PNotary"`
StateRoot StateRoot `yaml:"StateRoot"`
// ExtensiblePoolSize is the maximum amount of the extensible payloads from a single sender.
ExtensiblePoolSize int `yaml:"ExtensiblePoolSize"`
}
// EqualsButServices returns true when the o is the same as a except for services
// (Oracle, P2PNotary, Pprof, Prometheus, RPC, StateRoot and UnlockWallet sections).
func (a *ApplicationConfiguration) EqualsButServices(o *ApplicationConfiguration) bool {
if a.Address != o.Address ||
a.AnnouncedNodePort != o.AnnouncedNodePort ||
a.AttemptConnPeers != o.AttemptConnPeers ||
a.DBConfiguration != o.DBConfiguration ||
a.DialTimeout != o.DialTimeout ||
a.ExtensiblePoolSize != o.ExtensiblePoolSize ||
a.LogPath != o.LogPath ||
a.MaxPeers != o.MaxPeers ||
a.MinPeers != o.MinPeers ||
a.NodePort != o.NodePort ||
a.PingInterval != o.PingInterval ||
a.PingTimeout != o.PingTimeout ||
a.ProtoTickInterval != o.ProtoTickInterval ||
a.Relay != o.Relay {
return false
}
return true
}