Documentation ¶
Overview ¶
Package ghost implements a barebones, ephemeral Sia host. It is used for testing purposes only, not hosting actual renter data on the Sia network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSettings = hostdb.HostSettings{ AcceptingContracts: true, MaxDuration: 144, MaxCollateral: types.SiacoinPrecision.Mul64(1e9), ContractPrice: types.SiacoinPrecision, StoragePrice: types.SiacoinPrecision.Div64(1e9), UploadBandwidthPrice: types.SiacoinPrecision.Div64(2e9), DownloadBandwidthPrice: types.SiacoinPrecision.Div64(3e9), WindowSize: 5, Version: "1.5.0", Make: "ghost", Model: "v0.1.0", }
DefaultSettings are the default (cheap) ghost settings.
View Source
var FreeSettings = hostdb.HostSettings{ AcceptingContracts: true, MaxDuration: 144, MaxCollateral: types.ZeroCurrency, ContractPrice: types.NewCurrency64(1), StoragePrice: types.ZeroCurrency, UploadBandwidthPrice: types.ZeroCurrency, DownloadBandwidthPrice: types.ZeroCurrency, WindowSize: 5, Version: "1.5.0", Make: "ghost", Model: "v0.1.0", }
FreeSettings are the cheapest possible ghost settings.
NOTE: it is not possible for contracts to be completely free, because consensus rules disallow FileContracts whose Payout field is 0.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct { Settings hostdb.HostSettings PublicKey hostdb.HostPublicKey // contains filtered or unexported fields }
A Host is an ephemeral Sia host.
func New ¶
func New(tb testing.TB, settings hostdb.HostSettings, wm host.Wallet, tpool host.TransactionPool) *Host
New returns an initialized host that listens for incoming sessions on a random localhost port. The host is automatically closed with tb.Cleanup.
func (*Host) ProcessConsensusChange ¶ added in v0.19.0
func (h *Host) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange implements modules.ConsensusSetSubscriber.
Click to show internal directories.
Click to hide internal directories.