2024-01-06 18:23:54 +00:00
|
|
|
package config
|
2024-01-06 11:33:46 +00:00
|
|
|
|
|
|
|
import (
|
2024-03-09 11:46:48 +00:00
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/db"
|
2024-01-06 11:33:46 +00:00
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/ed25519"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NodeConfig struct {
|
2024-02-27 08:11:00 +00:00
|
|
|
P2P P2PConfig `mapstructure:"p2p"`
|
2024-01-06 18:15:29 +00:00
|
|
|
KeyPair *ed25519.KeyPairEd25519
|
2024-03-09 11:46:48 +00:00
|
|
|
DB db.KVStore
|
2024-01-06 11:33:46 +00:00
|
|
|
Logger *zap.Logger
|
2024-02-27 08:11:00 +00:00
|
|
|
HTTP HTTPConfig `mapstructure:"http"`
|
2024-01-06 11:33:46 +00:00
|
|
|
}
|
|
|
|
type P2PConfig struct {
|
2024-02-27 08:11:00 +00:00
|
|
|
Network string `mapstructure:"network"`
|
|
|
|
Peers PeersConfig `mapstructure:"peers"`
|
|
|
|
MaxOutgoingPeerFailures uint `mapstructure:"max_outgoing_peer_failures"`
|
2024-03-05 20:13:25 +00:00
|
|
|
MaxConnectionAttempts uint `mapstructure:"max_connection_attempts"`
|
2024-01-06 11:33:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type PeersConfig struct {
|
2024-02-23 12:23:33 +00:00
|
|
|
Initial []string `mapstructure:"initial"`
|
2024-01-06 11:33:46 +00:00
|
|
|
}
|
2024-01-10 14:35:47 +00:00
|
|
|
|
|
|
|
type HTTPAPIConfig struct {
|
2024-02-23 12:23:33 +00:00
|
|
|
Domain string `mapstructure:"domain"`
|
|
|
|
Port uint `mapstructure:"port"`
|
2024-01-10 14:35:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type HTTPConfig struct {
|
2024-02-27 08:11:00 +00:00
|
|
|
API HTTPAPIConfig `mapstructure:"api"`
|
2024-01-10 14:35:47 +00:00
|
|
|
}
|