networkoptions

package
v1.21.41 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSupportedNetworkOptions = []NetworkOption{
		Local,
		Devnet,
		Testnet,
		Mainnet,
	}
	NonLocalSupportedNetworkOptions = []NetworkOption{
		Devnet,
		Testnet,
		Mainnet,
	}
	NonMainnetSupportedNetworkOptions = []NetworkOption{
		Local,
		Devnet,
		Testnet,
	}
	LocalClusterSupportedNetworkOptions = []NetworkOption{
		Local,
		Cluster,
	}
)

Functions

func AddNetworkFlagsToCmd

func AddNetworkFlagsToCmd(cmd *cobra.Command, networkFlags *NetworkFlags, addEndpoint bool, supportedNetworkOptions []NetworkOption)

func GetNetworkFlagsGroup

func GetNetworkFlagsGroup(cmd *cobra.Command, networkFlags *NetworkFlags, addEndpoint bool, supportedNetworkOptions []NetworkOption) flags.GroupedFlags

func GetNetworkFromCmdLineFlags

func GetNetworkFromCmdLineFlags(
	app *application.Lux,
	promptStr string,
	networkFlags NetworkFlags,
	requireDevnetEndpointSpecification bool,
	onlyEndpointBasedDevnets bool,
	supportedNetworkOptions []NetworkOption,
	subnetName string,
) (models.Network, error)

Types

type CustomEndpointNetwork

type CustomEndpointNetwork struct {
	models.Network
	Endpoint string
}

CustomEndpointNetwork wraps a Network with a custom endpoint

func (*CustomEndpointNetwork) GetEndpoint

func (c *CustomEndpointNetwork) GetEndpoint() string

GetEndpoint returns the custom endpoint

type NetworkFlags

type NetworkFlags struct {
	UseLocal    bool
	UseDevnet   bool
	UseTestnet  bool
	UseMainnet  bool
	Endpoint    string
	ClusterName string
}

type NetworkOption

type NetworkOption int64
const (
	Undefined NetworkOption = iota
	Mainnet
	Testnet
	Local
	Devnet
	Cluster
)

func GetNetworkFromSidecar

func GetNetworkFromSidecar(sc models.Sidecar, defaultOption []NetworkOption) []NetworkOption

func GetSupportedNetworkOptionsForSubnet

func GetSupportedNetworkOptionsForSubnet(
	app *application.Lux,
	subnetName string,
	supportedNetworkOptions []NetworkOption,
) ([]NetworkOption, []string, []string, error)

func NetworkOptionFromString

func NetworkOptionFromString(s string) NetworkOption

func (NetworkOption) String

func (n NetworkOption) String() string

Jump to

Keyboard shortcuts

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