host

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2015 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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

View Source
var (
	HostCapacityErr = errors.New("host is at capacity and can not 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.State, tpool modules.TransactionPool, wallet modules.Wallet, addr string, saveDir string) (h *Host, err error)

New returns an initialized Host.

func (*Host) Address added in v0.3.1

func (h *Host) Address() modules.NetAddress

func (*Host) Announce

func (h *Host) Announce() error

Announce creates a host announcement transaction, adding information to the arbitrary data, signing the transaction, and submitting it to the transaction pool.

func (*Host) HostNotify added in v0.3.1

func (h *Host) HostNotify() <-chan struct{}

HostNotify returns a channel that will be sent a struct{} every time there is an update received from another module.

func (*Host) Info

func (h *Host) Info() modules.HostInfo

func (*Host) ReceiveConsensusSetUpdate added in v0.3.1

func (h *Host) ReceiveConsensusSetUpdate(cc modules.ConsensusChange)

RecieveConsensusSetUpdate will be called by the consensus set every time there is a new block or a fork of some kind.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL