Lux SDKGoPackages

network

Package network provides network configuration and management utilities.

import "github.com/luxfi/sdk/network"

Package network provides network configuration and management utilities.

Types

ChainConfig

ChainConfig defines configuration for a chain

LegacyNetwork

LegacyNetwork represents a network configuration with endpoint This is for compatibility with existing code

func GetNetworkByName(name string) (LegacyNetwork, error)
func NetworkFromNetworkID(networkID uint32) LegacyNetwork

Network

Network represents a managed Lux network

NetworkKind

NetworkKind represents the kind of network

func (k NetworkKind) String() string

NetworkManager

NetworkManager handles all network operations using netrunner

func NewNetworkManager(config *config.NetworkConfig, logger log.Logger) (*NetworkManager, error)
func (nm *NetworkManager) AddNode(ctx context.Context, networkID string, nodeParams *NodeParams) (*Node, error)
func (nm *NetworkManager) CreateNetwork(ctx context.Context, params *NetworkParams) (*Network, error)
func (nm *NetworkManager) DeleteNetwork(ctx context.Context, networkID string) error
func (nm *NetworkManager) GetNetwork(networkID string) (*Network, error)
func (nm *NetworkManager) GetNodeStatus(ctx context.Context, networkID, nodeID string) (*NodeStatus, error)
func (nm *NetworkManager) ListNetworks() []*Network
func (nm *NetworkManager) RemoveNode(ctx context.Context, networkID, nodeID string) error
func (nm *NetworkManager) StartNetwork(ctx context.Context, networkID string) error
func (nm *NetworkManager) StopNetwork(ctx context.Context, networkID string) error

NetworkParams

NetworkParams defines parameters for creating a network

NetworkStatus

NetworkStatus defines the status of a network

NetworkType

NetworkType defines the type of network

Node

Node represents a node in the network

NodeParams

NodeParams defines parameters for adding a node

NodeStatus

NodeStatus defines the status of a node

NodeType

NodeType defines the type of node