Documentation ¶
Index ¶
- func RegisterFiveNodeSubnetRun() func() *Subnet
- type ANRConfig
- type NetworkManager
- func (n *NetworkManager) CloseClient() error
- func (n *NetworkManager) GetAllURIs(ctx context.Context) ([]string, error)
- func (n *NetworkManager) GetSubnet(subnetID ids.ID) (*Subnet, bool)
- func (n *NetworkManager) GetSubnets() []ids.ID
- func (n *NetworkManager) SetupNetwork(ctx context.Context, execPath string, blockchainSpecs []*rpcpb.BlockchainSpec) error
- func (n *NetworkManager) StartDefaultNetwork(ctx context.Context) (<-chan struct{}, error)
- func (n *NetworkManager) TeardownNetwork() error
- type Subnet
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 LuxdExecPath string PluginDir string GlobalNodeConfig string GlobalCChainConfig string }
func NewDefaultANRConfig ¶
func NewDefaultANRConfig() ANRConfig
NewDefaultANRConfig returns a default config for launching the lux-network-runner manager with both a server and client. By default, it expands $GOPATH/src/github.com/luxdefi/node/build/ directory to extract the LuxdExecPath and PluginDir arguments. If the LUXD_BUILD_PATH environment variable is set, it overrides the default location for the LuxdExecPath 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) GetAllURIs ¶
func (n *NetworkManager) GetAllURIs(ctx context.Context) ([]string, error)
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 Luxd 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 `json:"subnetID"` // Current ANR assumes one blockchain per subnet, so we have a single blockchainID here BlockchainID ids.ID `json:"blockchainID"` // ValidatorURIs is the base URIs for each participant of the Subnet ValidatorURIs []string `json:"validatorURIs"` }
Subnet provides the basic details of a created subnet Note: currently assumes one blockchain per subnet