Documentation ¶
Index ¶
- Constants
- Variables
- type Host
- func (h *Host) Address() modules.NetAddress
- func (h *Host) Announce() error
- func (h *Host) Close() error
- func (h *Host) ForceAnnounce(addr modules.NetAddress) error
- func (h *Host) Info() modules.HostInfo
- func (h *Host) ProcessConsensusChange(cc modules.ConsensusChange)
- func (h *Host) SetSettings(settings modules.HostSettings)
- func (h *Host) Settings() modules.HostSettings
Constants ¶
const ( // StorageProofReorgDepth states how many blocks to wait before submitting // a storage proof. This reduces the chance of needing to resubmit because // of a reorg. StorageProofReorgDepth = 10 )
Variables ¶
var (
HostCapacityErr = errors.New("host is at capacity and cannot take more files")
)
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct { modules.HostSettings // 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 *consensus.ConsensusSet, hdb modules.HostDB, tpool modules.TransactionPool, wallet modules.Wallet, addr string, saveDir string) (*Host, error)
New returns an initialized Host.
func (*Host) Address ¶ added in v0.3.1
func (h *Host) Address() modules.NetAddress
func (*Host) Announce ¶
Announce creates a host announcement transaction, adding information to the arbitrary data, signing the transaction, and submitting it to the transaction pool.
func (*Host) ForceAnnounce ¶
func (h *Host) ForceAnnounce(addr modules.NetAddress) error
ForceAnnounce announces using the provided address, and without performing any connectivity checks.
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) SetSettings ¶
func (h *Host) SetSettings(settings modules.HostSettings)
SetConfig updates the host's internal HostSettings object. To modify a specific field, use a combination of Info and SetConfig
func (*Host) Settings ¶
func (h *Host) Settings() modules.HostSettings
Settings returns the settings of a host.