runner

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 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 NetworkManager

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

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

func NewNetworkManager

func NewNetworkManager(config ONRConfig) *NetworkManager

NewNetworkManager constructs a new instance of a network manager

func (*NetworkManager) CloseClient

func (n *NetworkManager) CloseClient() error

CloseClient closes the connection between the ONR 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 OdysseyGo 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 ONRConfig

type ONRConfig struct {
	LogLevel          string
	OdysseyGoExecPath string
	PluginDir         string
	GlobalNodeConfig  string
}

func NewDefaultONRConfig

func NewDefaultONRConfig() ONRConfig

NewDefaultONRConfig returns a default config for launching the odyssey-network-runner manager with both a server and client. By default, it expands $GOPATH/src/github.com/DioneProtocol/odysseygo/build/ directory to extract the OdysseyGoExecPath and PluginDir arguments. If the ODYSSEYGO_BUILD_PATH environment variable is set, it overrides the default location for the OdysseyGoExecPath and PluginDir arguments.

type Subnet

type Subnet struct {
	// SubnetID is the txID of the transaction that created the subnet
	SubnetID ids.ID
	// Current ONR 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