Documentation ¶
Index ¶
- type Manager
- func (m *Manager) ActiveHosts() ([]modules.HostDBEntry, error)
- func (m *Manager) Alerts() (crit, err, warn, info []modules.Alert)
- func (m *Manager) AllHosts() ([]modules.HostDBEntry, error)
- func (m *Manager) BlockHeight() uint64
- func (m *Manager) Close() error
- func (m *Manager) Contract(fcid types.FileContractID) (modules.RenterContract, bool)
- func (m *Manager) ContractPriceEstimation(hpk types.PublicKey, endHeight uint64, storage uint64, upload uint64, ...) (types.Currency, float64, error)
- func (m *Manager) Contracts() []modules.RenterContract
- func (m *Manager) ContractsByRenter(rpk types.PublicKey) []modules.RenterContract
- func (m *Manager) CreateNewRenter(email string, pk types.PublicKey)
- func (m *Manager) DeleteMetadata(pk types.PublicKey)
- func (m *Manager) DeleteObject(pk types.PublicKey, path string) error
- func (m *Manager) DeleteRenter(email string)
- func (m *Manager) EstimateHostScore(a modules.Allowance, e modules.HostDBEntry) (modules.HostScoreBreakdown, error)
- func (m *Manager) FeeEstimation() (min, max types.Currency)
- func (m *Manager) Filter() (modules.FilterMode, map[string]types.PublicKey, []string, error)
- func (m *Manager) FormContract(s *modules.RPCSession, rpk types.PublicKey, epk types.PublicKey, ...) (modules.RenterContract, error)
- func (m *Manager) FormContracts(rpk types.PublicKey, rsk types.PrivateKey, a modules.Allowance) ([]modules.RenterContract, error)
- func (m *Manager) GetAverages() modules.HostAverages
- func (m *Manager) GetBalance(email string) (modules.UserBalance, error)
- func (m *Manager) GetExchangeRate(currency string) (float64, error)
- func (m *Manager) GetRenter(rpk types.PublicKey) (modules.Renter, error)
- func (m *Manager) GetSiacoinRate(currency string) (float64, error)
- func (m *Manager) GetWalletSeed() (seed modules.Seed, err error)
- func (m *Manager) Host(pk types.PublicKey) (modules.HostDBEntry, bool, error)
- func (m *Manager) IncrementStats(email string, renewed bool) (err error)
- func (m *Manager) InitialScanComplete() (bool, uint64, error)
- func (m *Manager) LockSiacoins(email string, amount float64) error
- func (m *Manager) OldContracts() []modules.RenterContract
- func (m *Manager) OldContractsByRenter(rpk types.PublicKey) []modules.RenterContract
- func (m *Manager) PriceEstimation(allowance modules.Allowance) (float64, modules.Allowance, error)
- func (m *Manager) ProcessConsensusChange(cc modules.ConsensusChange)
- func (m *Manager) RandomHosts(n uint64, a modules.Allowance) ([]modules.HostDBEntry, error)
- func (m *Manager) RefreshedContract(fcid types.FileContractID) bool
- func (m *Manager) RenewContract(s *modules.RPCSession, rpk types.PublicKey, fcid types.FileContractID, ...) (modules.RenterContract, error)
- func (m *Manager) RenewContracts(rpk types.PublicKey, rsk types.PrivateKey, a modules.Allowance, ...) ([]modules.RenterContract, error)
- func (m *Manager) RenewedFrom(fcid types.FileContractID) types.FileContractID
- func (m *Manager) Renters() []modules.Renter
- func (m *Manager) RetrieveMetadata(pk types.PublicKey, present []string) ([]modules.FileMetadata, error)
- func (m *Manager) RetrieveSpendings(email string, currency string) (modules.UserSpendings, error)
- func (m *Manager) ScoreBreakdown(e modules.HostDBEntry) (modules.HostScoreBreakdown, error)
- func (m *Manager) SetAllowance(rpk types.PublicKey, a modules.Allowance) error
- func (m *Manager) SetFilterMode(lm modules.FilterMode, hosts []types.PublicKey, netAddresses []string) error
- func (m *Manager) UnlockSiacoins(email string, amount, total float64, height uint64) error
- func (m *Manager) UpdateBalance(email string, ub modules.UserBalance) error
- func (m *Manager) UpdateContract(rev types.FileContractRevision, sigs []types.TransactionSignature, ...) error
- func (m *Manager) UpdateMetadata(pk types.PublicKey, fm modules.FileMetadata) error
- func (m *Manager) UpdateRenterSettings(rpk types.PublicKey, settings modules.RenterSettings, sk types.PrivateKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
A Manager contains the information necessary to communicate with the hosts.
func New ¶
func New(db *sql.DB, cs modules.ConsensusSet, g modules.Gateway, tpool modules.TransactionPool, wallet modules.Wallet, dir string) (*Manager, <-chan error)
New returns an initialized Manager.
func (*Manager) ActiveHosts ¶
func (m *Manager) ActiveHosts() ([]modules.HostDBEntry, error)
ActiveHosts returns an array of hostDB's active hosts.
func (*Manager) AllHosts ¶
func (m *Manager) AllHosts() ([]modules.HostDBEntry, error)
AllHosts returns an array of all hosts.
func (*Manager) BlockHeight ¶
BlockHeight returns the current block height.
func (*Manager) Contract ¶
func (m *Manager) Contract(fcid types.FileContractID) (modules.RenterContract, bool)
Contract calls hostContractor.Contract.
func (*Manager) ContractPriceEstimation ¶
func (m *Manager) ContractPriceEstimation(hpk types.PublicKey, endHeight uint64, storage uint64, upload uint64, download uint64, minShards uint64, totalShards uint64) (types.Currency, float64, error)
ContractPriceEstimation estimates the cost in siacoins of forming a contract with the given host.
func (*Manager) Contracts ¶
func (m *Manager) Contracts() []modules.RenterContract
Contracts returns the hostContractor's contracts.
func (*Manager) ContractsByRenter ¶
func (m *Manager) ContractsByRenter(rpk types.PublicKey) []modules.RenterContract
ContractsByRenter returns the contracts belonging to a specific renter.
func (*Manager) CreateNewRenter ¶
CreateNewRenter calls hostContractor.CreateNewRenter.
func (*Manager) DeleteMetadata ¶
DeleteMetadata deletes the renter's saved file metadata.
func (*Manager) DeleteObject ¶
DeleteObject deletes the saved file metadata object.
func (*Manager) DeleteRenter ¶
DeleteRenter deletes the renter data from the memory.
func (*Manager) EstimateHostScore ¶
func (m *Manager) EstimateHostScore(a modules.Allowance, e modules.HostDBEntry) (modules.HostScoreBreakdown, error)
EstimateHostScore returns the estimated host score.
func (*Manager) FeeEstimation ¶
FeeEstimation returns the minimum and the maximum estimated fees for a transaction.
func (*Manager) FormContract ¶
func (m *Manager) FormContract(s *modules.RPCSession, rpk types.PublicKey, epk types.PublicKey, hpk types.PublicKey, endHeight uint64, storage uint64, upload uint64, download uint64, minShards uint64, totalShards uint64) (modules.RenterContract, error)
FormContract creates a contract with a single host using the new Renter-Satellite protocol.
func (*Manager) FormContracts ¶
func (m *Manager) FormContracts(rpk types.PublicKey, rsk types.PrivateKey, a modules.Allowance) ([]modules.RenterContract, error)
FormContracts forms the specified number of contracts with the hosts and returns them.
func (*Manager) GetAverages ¶
func (m *Manager) GetAverages() modules.HostAverages
GetAverages retrieves the host network averages from HostDB.
func (*Manager) GetBalance ¶
func (m *Manager) GetBalance(email string) (modules.UserBalance, error)
GetBalance retrieves the balance information on the account. An empty struct is returned when there is no data.
func (*Manager) GetExchangeRate ¶
GetExchangeRate returns the exchange rate of a given currency.
func (*Manager) GetSiacoinRate ¶
GetSiacoinRate calculates the SC price in a given currency.
func (*Manager) GetWalletSeed ¶
GetWalletSeed returns the wallet seed.
func (*Manager) IncrementStats ¶
IncrementStats increments the number of formed or renewed contracts.
func (*Manager) InitialScanComplete ¶
InitialScanComplete returns a boolean indicating if the initial scan of the hostdb is completed.
func (*Manager) LockSiacoins ¶
LockSiacoins locks the specified amount of Siacoins in the user balance.
func (*Manager) OldContracts ¶
func (m *Manager) OldContracts() []modules.RenterContract
OldContracts calls hostContractor.OldContracts expired.
func (*Manager) OldContractsByRenter ¶
func (m *Manager) OldContractsByRenter(rpk types.PublicKey) []modules.RenterContract
OldContractsByRenter returns the old contracts of a specific renter.
func (*Manager) PriceEstimation ¶
PriceEstimation estimates the cost in siacoins of forming contracts with the hosts. The estimation will be done using the provided allowance. The final allowance used will be returned.
func (*Manager) ProcessConsensusChange ¶
func (m *Manager) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange gets called to inform Manager about the changes in the consensus set.
func (*Manager) RandomHosts ¶
RandomHosts picks up to the specified number of random hosts from the hostdb sorted by score.
func (*Manager) RefreshedContract ¶
func (m *Manager) RefreshedContract(fcid types.FileContractID) bool
RefreshedContract calls hostContractor.RefreshedContract
func (*Manager) RenewContract ¶
func (m *Manager) RenewContract(s *modules.RPCSession, rpk types.PublicKey, fcid types.FileContractID, endHeight uint64, storage uint64, upload uint64, download uint64, minShards uint64, totalShards uint64) (modules.RenterContract, error)
RenewContract renews a contract using the new Renter-Satellite protocol.
func (*Manager) RenewContracts ¶
func (m *Manager) RenewContracts(rpk types.PublicKey, rsk types.PrivateKey, a modules.Allowance, contracts []types.FileContractID) ([]modules.RenterContract, error)
RenewContracts renews a set of contracts and returns a new set.
func (*Manager) RenewedFrom ¶
func (m *Manager) RenewedFrom(fcid types.FileContractID) types.FileContractID
RenewedFrom returns the ID of the contract the given contract was renewed from, if any.
func (*Manager) RetrieveMetadata ¶
func (m *Manager) RetrieveMetadata(pk types.PublicKey, present []string) ([]modules.FileMetadata, error)
RetrieveMetadata retrieves the file metadata from the database.
func (*Manager) RetrieveSpendings ¶
RetrieveSpendings retrieves the user's spendings in the given currency.
func (*Manager) ScoreBreakdown ¶
func (m *Manager) ScoreBreakdown(e modules.HostDBEntry) (modules.HostScoreBreakdown, error)
ScoreBreakdown returns the score breakdown of the specific host.
func (*Manager) SetAllowance ¶
SetAllowance calls hostContractor.SetAllowance.
func (*Manager) SetFilterMode ¶
func (m *Manager) SetFilterMode(lm modules.FilterMode, hosts []types.PublicKey, netAddresses []string) error
SetFilterMode sets the hostdb filter mode.
func (*Manager) UnlockSiacoins ¶
UnlockSiacoins unlocks the specified amount of Siacoins in the user balance.
func (*Manager) UpdateBalance ¶
func (m *Manager) UpdateBalance(email string, ub modules.UserBalance) error
UpdateBalance updates the balance information on the account.
func (*Manager) UpdateContract ¶
func (m *Manager) UpdateContract(rev types.FileContractRevision, sigs []types.TransactionSignature, uploads, downloads, fundAccount types.Currency) error
UpdateContract updates the contract with the new revision.
func (*Manager) UpdateMetadata ¶
UpdateMetadata updates the file metadata in the database.
func (*Manager) UpdateRenterSettings ¶
func (m *Manager) UpdateRenterSettings(rpk types.PublicKey, settings modules.RenterSettings, sk types.PrivateKey) error
UpdateRenterSettings calls hostContractor.UpdateRenterSettings.
Directories ¶
Path | Synopsis |
---|---|
Package hostdb provides a HostDB object that implements the Manager.HostDB interface.
|
Package hostdb provides a HostDB object that implements the Manager.HostDB interface. |