2020-03-25 15:30:21 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
2022-07-08 16:42:06 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
|
2020-03-25 15:30:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ApplicationConfiguration config specific to the node.
|
|
|
|
type ApplicationConfiguration struct {
|
2022-10-13 19:14:14 +00:00
|
|
|
Address string `yaml:"Address"`
|
|
|
|
AnnouncedNodePort uint16 `yaml:"AnnouncedPort"`
|
|
|
|
AttemptConnPeers int `yaml:"AttemptConnPeers"`
|
|
|
|
// BroadcastFactor is the factor (0-100) controlling gossip fan-out number optimization.
|
|
|
|
BroadcastFactor int `yaml:"BroadcastFactor"`
|
2022-07-08 16:42:06 +00:00
|
|
|
DBConfiguration dbconfig.DBConfiguration `yaml:"DBConfiguration"`
|
|
|
|
DialTimeout int64 `yaml:"DialTimeout"`
|
2022-12-05 11:58:16 +00:00
|
|
|
LogLevel string `yaml:"LogLevel"`
|
2022-07-08 16:42:06 +00:00
|
|
|
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"`
|
2022-07-22 16:17:48 +00:00
|
|
|
RPC RPC `yaml:"RPC"`
|
2022-07-08 16:42:06 +00:00
|
|
|
UnlockWallet Wallet `yaml:"UnlockWallet"`
|
|
|
|
Oracle OracleConfiguration `yaml:"Oracle"`
|
|
|
|
P2PNotary P2PNotary `yaml:"P2PNotary"`
|
|
|
|
StateRoot StateRoot `yaml:"StateRoot"`
|
2021-05-04 14:54:16 +00:00
|
|
|
// ExtensiblePoolSize is the maximum amount of the extensible payloads from a single sender.
|
|
|
|
ExtensiblePoolSize int `yaml:"ExtensiblePoolSize"`
|
2020-03-25 15:30:21 +00:00
|
|
|
}
|
2022-07-26 13:16:48 +00:00
|
|
|
|
|
|
|
// EqualsButServices returns true when the o is the same as a except for services
|
2022-12-05 11:58:16 +00:00
|
|
|
// (Oracle, P2PNotary, Pprof, Prometheus, RPC, StateRoot and UnlockWallet sections)
|
|
|
|
// and LogLevel field.
|
2022-07-26 13:16:48 +00:00
|
|
|
func (a *ApplicationConfiguration) EqualsButServices(o *ApplicationConfiguration) bool {
|
|
|
|
if a.Address != o.Address ||
|
|
|
|
a.AnnouncedNodePort != o.AnnouncedNodePort ||
|
|
|
|
a.AttemptConnPeers != o.AttemptConnPeers ||
|
2022-10-13 19:14:14 +00:00
|
|
|
a.BroadcastFactor != o.BroadcastFactor ||
|
2022-07-26 13:16:48 +00:00
|
|
|
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
|
|
|
|
}
|