Documentation ¶
Overview ¶
Package ant provides an abstraction for the functionality of 'ants' in the antfarm. Ants are Sia clients that have a myriad of user stories programmed as their behavior and report their successfullness at each user store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ant ¶
type Ant struct { APIAddr string RPCAddr string Config AntConfig // A variable to track which blocks + heights the sync detector has seen // for this ant. The map will just keep growing, but it shouldn't take up a // prohibitive amount of space. SeenBlocks map[types.BlockHeight]types.BlockID `json:"-"` // contains filtered or unexported fields }
An Ant is a Sia Client programmed with network user stories. It executes these user stories and reports on their successfulness.
func (*Ant) BlockHeight ¶
func (a *Ant) BlockHeight() types.BlockHeight
BlockHeight returns the highest block height seen by the ant.
func (*Ant) StartJob ¶
StartJob starts the job indicated by `job` after an ant has been initialized. Arguments are passed to the job using args.
func (*Ant) WalletAddress ¶
func (a *Ant) WalletAddress() (*types.UnlockHash, error)
WalletAddress returns a wallet address that this ant can receive coins on.
type AntConfig ¶
type AntConfig struct { APIAddr string `json:",omitempty"` RPCAddr string `json:",omitempty"` HostAddr string `json:",omitempty"` SiaDirectory string `json:",omitempty"` Name string `json:",omitempty"` SiadPath string Jobs []string DesiredCurrency uint64 }
AntConfig represents a configuration object passed to New(), used to configure a newly created Sia Ant.