Documentation ¶
Index ¶
- Constants
- Variables
- type ChainManager
- type CloudflareSettings
- type ConfigManager
- func (m *ConfigManager) Announce() error
- func (m *ConfigManager) BandwidthLimiters() (ingress, egress *rate.Limiter)
- func (m *ConfigManager) Close() error
- func (m *ConfigManager) DiscoveredRHP2Address() string
- func (m *ConfigManager) RHP3TLSConfig() *tls.Config
- func (m *ConfigManager) Settings() Settings
- func (m *ConfigManager) UpdateDynDNS(force bool) error
- func (m *ConfigManager) UpdateSettings(s Settings) error
- type DNSSettings
- type DuckDNSSettings
- type NoIPSettings
- type Route53Settings
- type Settings
- type Store
- type TransactionPool
- type Wallet
Constants ¶
const ( DNSProviderCloudflare = "cloudflare" DNSProviderDuckDNS = "duckdns" DNSProviderNoIP = "noip" DNSProviderRoute53 = "route53" )
defines DNS providers
Variables ¶
var ( // DefaultSettings are the default settings for the host DefaultSettings = Settings{ AcceptingContracts: false, NetAddress: "", MaxContractDuration: 6 * blocksPerMonth, ContractPrice: types.Siacoins(1).Div64(5), BaseRPCPrice: types.Siacoins(1).Div64(1e7), SectorAccessPrice: types.Siacoins(1).Div64(1e7), Collateral: types.Siacoins(100).Div64(1 << 40).Div64(blocksPerMonth), MaxCollateral: types.Siacoins(1000), MinStoragePrice: types.Siacoins(50).Div64(1 << 40).Div64(blocksPerMonth), MinEgressPrice: types.Siacoins(250).Div64(1 << 40), MinIngressPrice: types.Siacoins(10).Div64(1 << 40), PriceTableValidity: 30 * time.Minute, AccountExpiry: 30 * 24 * time.Hour, MaxAccountBalance: types.Siacoins(10), WindowSize: 144, MaxRegistryEntries: 100000, } // ErrNoSettings must be returned by the store if the host has no settings yet ErrNoSettings = errors.New("no settings found") )
Functions ¶
This section is empty.
Types ¶
type ChainManager ¶
A ChainManager manages the current consensus state
type CloudflareSettings ¶
CloudflareSettings contains the settings for the Cloudflare DNS provider.
type ConfigManager ¶
type ConfigManager struct {
// contains filtered or unexported fields
}
A ConfigManager manages the host's current configuration
func NewConfigManager ¶
func NewConfigManager(dir string, hostKey types.PrivateKey, rhp2Addr string, store Store, cm ChainManager, tp TransactionPool, w Wallet, log *zap.Logger) (*ConfigManager, error)
NewConfigManager initializes a new config manager
func (*ConfigManager) Announce ¶
func (m *ConfigManager) Announce() error
Announce announces the host to the network
func (*ConfigManager) BandwidthLimiters ¶
func (m *ConfigManager) BandwidthLimiters() (ingress, egress *rate.Limiter)
BandwidthLimiters returns the rate limiters for all traffic
func (*ConfigManager) DiscoveredRHP2Address ¶
func (m *ConfigManager) DiscoveredRHP2Address() string
DiscoveredRHP2Address returns the rhp2 address that was discovered by the gateway
func (*ConfigManager) RHP3TLSConfig ¶
func (m *ConfigManager) RHP3TLSConfig() *tls.Config
RHP3TLSConfig returns the TLS config for the rhp3 WebSocket listener
func (*ConfigManager) Settings ¶
func (m *ConfigManager) Settings() Settings
Settings returns the host's current settings.
func (*ConfigManager) UpdateDynDNS ¶
func (m *ConfigManager) UpdateDynDNS(force bool) error
UpdateDynDNS triggers an update of the host's dynamic DNS records.
func (*ConfigManager) UpdateSettings ¶
func (m *ConfigManager) UpdateSettings(s Settings) error
UpdateSettings updates the host's settings.
type DNSSettings ¶
type DNSSettings struct { Provider string `json:"provider"` IPv4 bool `json:"ipv4"` IPv6 bool `json:"ipv6"` Options json.RawMessage `json:"options"` }
DNSSettings contains the settings for the host's dynamic DNS.
type DuckDNSSettings ¶
type DuckDNSSettings struct {
Token string `json:"token"`
}
DuckDNSSettings contains the settings for the DuckDNS DNS provider.
type NoIPSettings ¶
NoIPSettings contains the settings for the No-IP DNS provider.
type Route53Settings ¶
type Route53Settings struct { ID string `json:"ID"` Secret string `json:"secret"` ZoneID string `json:"zoneID"` }
Route53Settings contains the settings for the Route53 DNS provider.
type Settings ¶
type Settings struct { // Host settings AcceptingContracts bool `json:"acceptingContracts"` NetAddress string `json:"netAddress"` MaxContractDuration uint64 `json:"maxContractDuration"` WindowSize uint64 `json:"windowSize"` // Pricing ContractPrice types.Currency `json:"contractPrice"` BaseRPCPrice types.Currency `json:"baseRPCPrice"` SectorAccessPrice types.Currency `json:"sectorAccessPrice"` Collateral types.Currency `json:"collateral"` MaxCollateral types.Currency `json:"maxCollateral"` MinStoragePrice types.Currency `json:"minStoragePrice"` MinEgressPrice types.Currency `json:"minEgressPrice"` MinIngressPrice types.Currency `json:"minIngressPrice"` PriceTableValidity time.Duration `json:"priceTableValidity"` // Registry settings MaxRegistryEntries uint64 `json:"maxRegistryEntries"` // RHP3 settings AccountExpiry time.Duration `json:"accountExpiry"` MaxAccountBalance types.Currency `json:"maxAccountBalance"` // Bandwidth limiter settings IngressLimit uint64 `json:"ingressLimit"` EgressLimit uint64 `json:"egressLimit"` // DNS settings DynDNS DNSSettings `json:"dynDNS"` Revision uint64 `json:"revision"` }
Settings contains configuration options for the host.
type Store ¶
type Store interface { // Settings returns the host's current settings. If the host has no // settings yet, ErrNoSettings must be returned. Settings() (Settings, error) // UpdateSettings updates the host's settings. UpdateSettings(s Settings) error }
A Store persists the host's settings
type TransactionPool ¶
type TransactionPool interface { AcceptTransactionSet([]types.Transaction) error RecommendedFee() types.Currency }
A TransactionPool broadcasts transactions to the network.