ghost

package
v0.19.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 15 Imported by: 0

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) Close

func (h *Host) Close() error

Close closes the host's listener.

func (*Host) ProcessConsensusChange added in v0.19.0

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

ProcessConsensusChange implements modules.ConsensusSetSubscriber.

Jump to

Keyboard shortcuts

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