Files
oc-discovery/conf/config.go

37 lines
850 B
Go
Raw Normal View History

2026-01-28 17:22:29 +01:00
package conf
import "sync"
type Config struct {
2026-03-03 16:38:24 +01:00
Name string
Hostname string
PSKPath string
PublicKeyPath string
PrivateKeyPath string
NodeEndpointPort int64
2026-02-20 12:42:18 +01:00
IndexerAddresses string
NativeIndexerAddresses string // multiaddrs of native indexers, comma-separated; bypasses IndexerAddresses when set
2026-01-28 17:22:29 +01:00
2026-02-03 15:25:15 +01:00
PeerIDS string // TO REMOVE
2026-01-30 16:57:36 +01:00
NodeMode string
2026-03-03 16:38:24 +01:00
MinIndexer int
MaxIndexer int
2026-03-05 15:22:02 +01:00
// ConsensusQuorum is the minimum fraction of natives that must agree for a
// candidate indexer to be considered confirmed. Range (0, 1]. Default 0.5
// (strict majority). Raise to 0.67 for stronger Byzantine resistance.
ConsensusQuorum float64
2026-01-28 17:22:29 +01:00
}
var instance *Config
var once sync.Once
func GetConfig() *Config {
once.Do(func() {
instance = &Config{}
})
return instance
}