Documentation ¶
Index ¶
- func RegisterFiveNodeSubnetRun() func() *Subnet
- type NetworkManager
- func (n *NetworkManager) CloseClient() 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 ONRConfig
- type Subnet
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