runner

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: GPL-3.0, LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFiveNodeSubnetRun

func RegisterFiveNodeSubnetRun() func() *Subnet

Types

type ANRConfig

type ANRConfig struct {
	LogLevel            string
	AvalancheGoExecPath string
	PluginDir           string
	GlobalNodeConfig    string
}

func NewDefaultANRConfig

func NewDefaultANRConfig() ANRConfig

NewDefaultANRConfig returns a default config for launching the avalanche-network-runner manager with both a server and client. By default, it expands $GOPATH/src/github.com/ava-labs/avalanchego/build/ directory to extract the AvalancheGoExecPath and PluginDir arguments. If the AVALANCHEGO_BUILD_PATH environment variable is set, it overrides the default location for the AvalancheGoExecPath and PluginDir arguments.

type NetworkManager

type NetworkManager struct {
	ANRConfig ANRConfig
	// contains filtered or unexported fields
}

NetworkManager is a wrapper around the ANR to simplify the setup and teardown code of tests that rely on the ANR.

func NewNetworkManager

func NewNetworkManager(config ANRConfig) *NetworkManager

NewNetworkManager constructs a new instance of a network manager

func (*NetworkManager) CloseClient

func (n *NetworkManager) CloseClient() error

CloseClient closes the connection between the ANR client and server without terminating the running network.

func (*NetworkManager) GetSubnet

func (n *NetworkManager) GetSubnet(subnetID ids.ID) (*Subnet, bool)

GetSubnet retrieves the subnet details for the requested subnetID

func (*NetworkManager) GetSubnets

func (n *NetworkManager) GetSubnets() []ids.ID

GetSubnets returns the IDs of the currently running subnets

func (*NetworkManager) SetupNetwork

func (n *NetworkManager) SetupNetwork(ctx context.Context, execPath string, blockchainSpecs []*rpcpb.BlockchainSpec) error

SetupNetwork constructs blockchains with the given [blockchainSpecs] and adds them to the network manager. Uses [execPath] as the AvalancheGo binary execution path for any started nodes. Note: this assumes that the default network has already been constructed.

func (*NetworkManager) StartDefaultNetwork

func (n *NetworkManager) StartDefaultNetwork(ctx context.Context) (<-chan struct{}, error)

StartDefaultNetwork constructs a default 5 node network.

func (*NetworkManager) TeardownNetwork

func (n *NetworkManager) TeardownNetwork() error

TeardownNetwork tears down the network constructed by the network manager and cleans up everything associated with it.

type Subnet

type Subnet struct {
	// SubnetID is the txID of the transaction that created the subnet
	SubnetID ids.ID
	// Current ANR assumes one blockchain per subnet, so we have a single blockchainID here
	BlockchainID ids.ID
	// ValidatorURIs is the base URIs for each participant of the Subnet
	ValidatorURIs []string
}

Subnet provides the basic details of a created subnet Note: currently assumes one blockchain per subnet

Jump to

Keyboard shortcuts

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