Documentation ¶
Overview ¶
Package host is an implementation of the host module, and is responsible for participating in the storage ecosystem, turning available disk space an internet bandwidth into profit for the user.
Index ¶
- type ErrorCommunication
- type ErrorConnection
- type ErrorConsensus
- type ErrorInternal
- type Host
- func (h *Host) Announce() error
- func (h *Host) AnnounceAddress(addr modules.NetAddress) error
- func (h *Host) Close() error
- func (h *Host) ConnectabilityStatus() modules.HostConnectabilityStatus
- func (h *Host) ExternalSettings() modules.HostExternalSettings
- func (h *Host) FinancialMetrics() modules.HostFinancialMetrics
- func (h *Host) InternalSettings() modules.HostInternalSettings
- func (h *Host) NetAddress() modules.NetAddress
- func (h *Host) NetworkMetrics() modules.HostNetworkMetrics
- func (h *Host) ProcessConsensusChange(cc modules.ConsensusChange)
- func (h *Host) PublicKey() types.SiaClassicPublicKey
- func (h *Host) SetInternalSettings(settings modules.HostInternalSettings) error
- func (h *Host) StorageObligations() (sos []modules.StorageObligation)
- func (h *Host) WorkingStatus() modules.HostWorkingStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCommunication ¶
type ErrorCommunication string
ErrorCommunication errors are meant to be returned if the host and the renter seem to be miscommunicating. For example, if the renter attempts to pay an insufficient price, there has been a communication error.
func (ErrorCommunication) Error ¶
func (ec ErrorCommunication) Error() string
Error satisfies the Error interface for the ErrorCommunication type.
type ErrorConnection ¶
type ErrorConnection string
ErrorConnection is meant to be used on errors where the network is returning unexpected errors. For example, sudden disconnects or connection write failures.
func (ErrorConnection) Error ¶
func (ec ErrorConnection) Error() string
Error satisfies the Error interface for the ErrorConnection type.
type ErrorConsensus ¶
type ErrorConsensus string
ErrorConsensus errors are meant to be used when there are problems related to consensus, such as an inability to submit a storage proof to the blockchain, or an inability to get a file contract revision on to the blockchain.
func (ErrorConsensus) Error ¶
func (ec ErrorConsensus) Error() string
Error satisfies the Error interface for the ErrorConsensus type.
type ErrorInternal ¶
type ErrorInternal string
ErrorInternal errors are meant to be used if an internal process in the host is malfunctioning, for example if the disk is failing.
func (ErrorInternal) Error ¶
func (ec ErrorInternal) Error() string
Error satisfies the Error interface for the ErrorInternal type.
type Host ¶
type Host struct { modules.StorageManager // contains filtered or unexported fields }
A Host contains all the fields necessary for storing files for clients and performing the storage proofs on the received files.
func New ¶
func New(cs modules.ConsensusSet, g modules.Gateway, tpool modules.TransactionPool, wallet modules.Wallet, address string, persistDir string) (*Host, error)
New returns an initialized Host.
func (*Host) AnnounceAddress ¶
func (h *Host) AnnounceAddress(addr modules.NetAddress) error
AnnounceAddress submits a host announcement to the blockchain to announce a specific address. If there is no error, the host's address will be updated to the supplied address.
func (*Host) ConnectabilityStatus ¶
func (h *Host) ConnectabilityStatus() modules.HostConnectabilityStatus
ConnectabilityStatus returns the connectability state of the host, whether the host can connect to itself on its configured netaddress.
func (*Host) ExternalSettings ¶
func (h *Host) ExternalSettings() modules.HostExternalSettings
ExternalSettings returns the hosts external settings. These values cannot be set by the user (host is configured through InternalSettings), and are the values that get displayed to other hosts on the network.
func (*Host) FinancialMetrics ¶
func (h *Host) FinancialMetrics() modules.HostFinancialMetrics
FinancialMetrics returns information about the financial commitments, rewards, and activities of the host.
func (*Host) InternalSettings ¶
func (h *Host) InternalSettings() modules.HostInternalSettings
InternalSettings returns the settings of a host.
func (*Host) NetAddress ¶
func (h *Host) NetAddress() modules.NetAddress
NetAddress returns the address at which the host can be reached.
func (*Host) NetworkMetrics ¶
func (h *Host) NetworkMetrics() modules.HostNetworkMetrics
NetworkMetrics returns information about the types of rpc calls that have been made to the host.
func (*Host) ProcessConsensusChange ¶
func (h *Host) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange will be called by the consensus set every time there is a change to the blockchain.
func (*Host) PublicKey ¶
func (h *Host) PublicKey() types.SiaClassicPublicKey
PublicKey returns the public key of the host that is used to facilitate relationships between the host and renter.
func (*Host) SetInternalSettings ¶
func (h *Host) SetInternalSettings(settings modules.HostInternalSettings) error
SetInternalSettings updates the host's internal HostInternalSettings object.
func (*Host) StorageObligations ¶
func (h *Host) StorageObligations() (sos []modules.StorageObligation)
StorageObligations fetches the set of storage obligations in the host and returns metadata on them.
func (*Host) WorkingStatus ¶
func (h *Host) WorkingStatus() modules.HostWorkingStatus
WorkingStatus returns the working state of the host, where working is defined as having received more than workingStatusThreshold settings calls over the period of workingStatusFrequency.
Source Files ¶
- announce.go
- consts.go
- dependencies.go
- errors.go
- host.go
- negotiate.go
- negotiatedownload.go
- negotiateformcontract.go
- negotiaterecentrevision.go
- negotiaterenewcontract.go
- negotiaterevisecontract.go
- negotiatesettings.go
- network.go
- persist.go
- persist_compat_1.2.0.go
- storageobligations.go
- storageobligationslock.go
- update.go
- upnp.go