e2e

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	// contains filtered or unexported fields
}

A Host is an ephemeral host that can be used for testing.

func NewHost

func NewHost(privKey types.PrivateKey, dir string, network *consensus.Network, debugLogging bool) (*Host, error)

NewHost initializes a new test host

func (*Host) AddVolume

func (h *Host) AddVolume(ctx context.Context, path string, size uint64) error

AddVolume adds a new volume to the host

func (*Host) Close

func (h *Host) Close() error

Close shutsdown the host

func (*Host) Contracts

func (h *Host) Contracts() *contracts.ContractManager

Contracts returns the host's contract manager

func (*Host) GatewayAddr

func (h *Host) GatewayAddr() string

GatewayAddr returns the address of the host's gateway.

func (*Host) PublicKey

func (h *Host) PublicKey() types.PublicKey

PublicKey returns the public key of the host

func (*Host) RHPv2Addr

func (h *Host) RHPv2Addr() string

RHPv2Addr returns the address of the RHPv2 listener

func (*Host) RHPv2Settings

func (h *Host) RHPv2Settings() (crhpv2.HostSettings, error)

RHPv2Settings returns the host's current RHPv2 settings

func (*Host) RHPv3Addr

func (h *Host) RHPv3Addr() string

RHPv3Addr returns the address of the RHPv3 listener

func (*Host) RHPv3PriceTable

func (h *Host) RHPv3PriceTable() (crhpv3.HostPriceTable, error)

RHPv3PriceTable returns the host's current RHPv3 price table

func (*Host) UpdateSettings

func (h *Host) UpdateSettings(settings settings.Settings) error

UpdateSettings updates the host's configuration

func (*Host) WalletAddress

func (h *Host) WalletAddress() types.Address

WalletAddress returns the host's wallet address

type TestCluster

type TestCluster struct {
	Autopilot *autopilot.Client
	Bus       *bus.Client
	Worker    *worker.Client
	S3        *minio.Client
	S3Core    *minio.Core
	// contains filtered or unexported fields
}

TestCluster is a helper type that allows for easily creating a number of nodes connected to each other and ready for testing.

func (*TestCluster) AddHost

func (c *TestCluster) AddHost(h *Host)

func (*TestCluster) AddHosts

func (c *TestCluster) AddHosts(n int) []*Host

AddHosts adds n hosts to the cluster. These hosts will be funded and announce themselves on the network, ready to form contracts.

func (*TestCluster) AddHostsBlocking

func (c *TestCluster) AddHostsBlocking(n int) []*Host

func (*TestCluster) AutopilotConfig

func (c *TestCluster) AutopilotConfig(ctx context.Context) (api.AutopilotConfig, uint64)

AutopilotConfig returns the autopilot's config and current period.

func (*TestCluster) MineBlocks

func (c *TestCluster) MineBlocks(n int)

MineBlocks uses the bus' miner to mine n blocks.

func (*TestCluster) MineToRenewWindow

func (c *TestCluster) MineToRenewWindow()

MineToRenewWindow is a helper which mines enough blocks for the autopilot to reach its renew window.

func (*TestCluster) NewHost

func (c *TestCluster) NewHost() *Host

func (*TestCluster) Reboot

func (c *TestCluster) Reboot(t *testing.T) *TestCluster

Reboot simulates a reboot of the cluster by calling Shutdown and creating a new cluster using the same settings as the previous one. NOTE: Simulating a reboot means that the hosts stay active and are not restarted.

func (*TestCluster) RemoveHost

func (c *TestCluster) RemoveHost(host *Host)

func (*TestCluster) Shutdown

func (c *TestCluster) Shutdown()

Shutdown shuts down a TestCluster.

func (*TestCluster) ShutdownAutopilot

func (tc *TestCluster) ShutdownAutopilot(ctx context.Context)

func (*TestCluster) ShutdownBus

func (tc *TestCluster) ShutdownBus(ctx context.Context)

func (*TestCluster) ShutdownS3

func (tc *TestCluster) ShutdownS3(ctx context.Context)

func (*TestCluster) ShutdownWorker

func (tc *TestCluster) ShutdownWorker(ctx context.Context)

func (*TestCluster) Sync

func (c *TestCluster) Sync()

Sync blocks until the whole cluster has reached the same block height.

func (*TestCluster) UpdateAutopilotConfig

func (c *TestCluster) UpdateAutopilotConfig(ctx context.Context, cfg api.AutopilotConfig)

UpdateAutopilotConfig updates the cluster's autopilot with given config.

func (*TestCluster) WaitForAccounts

func (c *TestCluster) WaitForAccounts() []api.Account

func (*TestCluster) WaitForContractSet

func (c *TestCluster) WaitForContractSet(set string, n int)

func (*TestCluster) WaitForContractSetContracts

func (c *TestCluster) WaitForContractSetContracts(set string, n int)

func (*TestCluster) WaitForContracts

func (c *TestCluster) WaitForContracts() []api.Contract

Jump to

Keyboard shortcuts

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