constants

package
v1.18.9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package constants provides SDK-specific constants. Many constants are re-exported from github.com/luxfi/constants for convenience.

Index

Constants

View Source
const (
	// Directory structure
	BaseDirName      = luxconstants.BaseDirName
	NodeBinaryName   = luxconstants.NodeBinaryName
	BinDir           = luxconstants.BinDir
	NetDir           = luxconstants.NetDir
	SnapshotsDir     = luxconstants.SnapshotsDir
	SnapshotsDirName = luxconstants.SnapshotsDirName
	RunsDir          = luxconstants.RunsDir
	RunDir           = luxconstants.RunDir
	PluginsDir       = luxconstants.PluginsDir
	PluginDir        = luxconstants.PluginDir
	LogDir           = luxconstants.LogDir
	ConfigDir        = luxconstants.ConfigDir
	KeyDir           = luxconstants.KeyDir
	ChainsDir        = luxconstants.ChainsDir
	CustomVMDir      = luxconstants.CustomVMDir
	ReposDir         = luxconstants.ReposDir
	LPMDir           = luxconstants.LPMDir
	LPMPluginDir     = luxconstants.LPMPluginDir
	DevDir           = luxconstants.DevDir
	LuxCliBinDir     = luxconstants.LuxCliBinDir

	// File permissions
	DefaultPerms755            = luxconstants.DefaultPerms755
	WriteReadReadPerms         = luxconstants.WriteReadReadPerms
	WriteReadOnlyPerms         = luxconstants.WriteReadOnlyPerms
	UserOnlyWriteReadExecPerms = luxconstants.UserOnlyWriteReadExecPerms

	// File names
	ElasticNetConfigFileName  = luxconstants.ElasticNetConfigFileName
	LPMLogName                = luxconstants.LPMLogName
	UpgradeBytesLockExtension = luxconstants.UpgradeBytesLockExtension

	// API endpoints
	LocalAPIEndpoint   = luxconstants.LocalAPIEndpoint
	TestnetAPIEndpoint = luxconstants.TestnetAPIEndpoint
	MainnetAPIEndpoint = luxconstants.MainnetAPIEndpoint

	// WebSocket endpoints
	LocalWSEndpoint   = luxconstants.LocalWSEndpoint
	TestnetWSEndpoint = luxconstants.TestnetWSEndpoint
	MainnetWSEndpoint = luxconstants.MainnetWSEndpoint

	// Default ports
	DefaultHTTPPort    = luxconstants.DefaultHTTPPort
	DefaultStakingPort = luxconstants.DefaultStakingPort
)

Re-export commonly used constants from luxfi/constants

View Source
const (
	APIRequestTimeout      = 30 * time.Second
	APIRequestLargeTimeout = 5 * time.Minute
	RequestTimeout         = 3 * time.Minute
)

Timeouts - SDK and VM specific

View Source
const (
	StakerCertFileName = "staker.crt"
	StakerKeyFileName  = "staker.key"
	BLSKeyFileName     = "signer.key"
)

Staking file names

View Source
const (
	AnsibleSSHShellParams = "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
	RemoteSSHUser         = "ubuntu"
)

SSH configuration for remote deployment

View Source
const (
	SnapshotPrefix      = luxconstants.SnapshotPrefix
	DefaultSnapshotName = luxconstants.DefaultSnapshotName
)

Snapshot constants

View Source
const Base = "/v1"

Base is the prefix every luxd route hangs off. There is one -- /v1/info, /v1/health, /v1/chain/P -- and the /ext prefix it replaced is gone from the node entirely, so an address built any other way is a 404.

Variables

This section is empty.

Functions

func Chain added in v1.18.9

func Chain(uri, alias string) string

Chain is the address of one chain's API -- /v1/chain/P, /v1/chain/X.

The segment is luxconstants.ChainAliasPrefix and not a literal because it MOVED: it was "bc" and is "chain". The node answers the old spelling too, so that callers may roll after it does; reading the constant is what makes this SDK one of the callers that has.

func Index added in v1.18.9

func Index(uri, chain, what string) string

Index is the address of one chain's index API -- /v1/index/C/block.

func Route added in v1.18.9

func Route(uri string, parts ...string) string

Route is the address of one of a node's APIs on the node at uri.

It is the ONE place this SDK composes a node address. Before it there were ten, every one of them carrying the /ext prefix the node stopped serving, which is the shape this drift always takes: an address is a string, a string is cheap to repeat, and each copy is somewhere to be wrong on its own.

func VM added in v1.18.9

func VM(uri, name string) string

VM is the address of a VM's static API: the handlers a VM serves before any chain of it exists, so they are keyed by the VM and not by a chain.

Types

This section is empty.

Jump to

Keyboard shortcuts

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