Documentation
¶
Overview ¶
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2020-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2024, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Constants
- func GetRPCEndpoint(baseEndpoint string, blockchainID string) string
- func GetWSEndpoint(baseEndpoint string, blockchainID string) string
- func HostAnsibleIDToCloudID(hostAnsibleID string) (string, string, error)
- func HostCloudIDToAnsibleID(cloudService string, hostCloudID string) (string, error)
- func NewHostConnection(h *Host, port uint) (*goph.Client, error)
- type BaseMigration
- type BridgeRoute
- type CLIDependencyMap
- type CloudConfig
- func (ccm *CloudConfig) GetAPIInstanceIDsForRegion(region string) []string
- func (ccm *CloudConfig) GetAllAPIInstanceIDs() []string
- func (ccm *CloudConfig) GetAllInstanceIDs() []string
- func (ccm *CloudConfig) GetInstanceIDsForRegion(region string) []string
- func (ccm *CloudConfig) GetRegions() []string
- type ClusterConfig
- func (cc *ClusterConfig) GetAPIHosts(hosts []*Host) []*Host
- func (cc *ClusterConfig) GetCloudIDs() []string
- func (cc *ClusterConfig) GetHostRoles(nodeConf NodeConfig) []string
- func (cc *ClusterConfig) GetValidatorHosts(hosts []*Host) []*Host
- func (cc *ClusterConfig) IsAPIHost(hostCloudID string) bool
- func (cc *ClusterConfig) IsLuxdHost(hostCloudID string) bool
- type ClustersConfig
- type ClustersConfigV0
- type ElasticSubnet
- type ElasticSubnetConfig
- type ExportCluster
- type ExportNode
- type Exportable
- type ExtraNetworkData
- type GCPConfig
- type GovernanceProposal
- type Host
- func (h *Host) Command(script string, env []string, timeout time.Duration) ([]byte, error)
- func (h *Host) Connect(port uint) error
- func (h *Host) Connected() bool
- func (h *Host) CreateTempDir() (string, error)
- func (h *Host) CreateTempFile() (string, error)
- func (h *Host) Disconnect() error
- func (h *Host) Download(remoteFile string, localFile string, timeout time.Duration) error
- func (h *Host) ExpandHome(path string) string
- func (h *Host) FileExists(path string) (bool, error)
- func (h *Host) Forward(httpRequest string, timeout time.Duration) ([]byte, error)
- func (h *Host) GetAnsibleInventoryRecord() string
- func (h *Host) GetCloudID() string
- func (h *Host) IsSystemD() bool
- func (h *Host) MkdirAll(remoteDir string, timeout time.Duration) error
- func (h *Host) ReadFileBytes(remoteFile string, timeout time.Duration) ([]byte, error)
- func (h *Host) Remove(path string, recursive bool) error
- func (h *Host) StreamSSHCommand(command string, env []string, timeout time.Duration) error
- func (h *Host) UntimedForward(httpRequest string) ([]byte, error)
- func (h *Host) UntimedMkdirAll(remoteDir string) error
- func (h *Host) Upload(localFile string, remoteFile string, timeout time.Duration) error
- func (h *Host) UploadBytes(data []byte, remoteFile string, timeout time.Duration) error
- func (h *Host) WaitForPort(port uint, timeout time.Duration) error
- func (h *Host) WaitForSSHShell(timeout time.Duration) error
- type L2Config
- type L3Config
- type LuxCompatiblity
- type LuxdCompatiblity
- type MigrationTx
- type MultisigTxInfo
- type Network
- func (s Network) BootstrappingContext() (context.Context, func())
- func (s Network) CChainEndpoint() string
- func (s Network) CChainWSEndpoint() string
- func (s Network) ClusterName() string
- func (s Network) Endpoint() string
- func (s Network) Equals(other Network) bool
- func (s Network) HandlePublicNetworkSimulation() bool
- func (s Network) ID() uint32
- func (s Network) Kind() Network
- func (s Network) Name() string
- func (s Network) NetworkID() (uint32, error)
- func (s Network) NetworkIDFlagValue() string
- func (s Network) SDKNetwork() interface{}
- func (s Network) String() string
- func (s Network) WSEndpoints() []string
- type NetworkData
- type NetworkVersions
- type NodeConfig
- type NodeResult
- type NodeResults
- func (nr *NodeResults) AddResult(nodeID string, value interface{}, err error)
- func (nr *NodeResults) GetErrorHostMap() map[string]error
- func (nr *NodeResults) GetErrorHosts() []string
- func (nr *NodeResults) GetNodeList() []string
- func (nr *NodeResults) GetResultMap() map[string]interface{}
- func (nr *NodeResults) GetResults() []NodeResult
- func (nr *NodeResults) HasErrors() bool
- func (nr *NodeResults) HasIDWithError(id string) bool
- func (nr *NodeResults) Len() int
- type PermissionlessValidators
- type PreconfirmConfig
- type RegionConfig
- type Sidecar
- type SubnetValidator
- type TokenInfo
- type VMCompatibility
- type VMType
Constants ¶
const ( EVM = "EVM" SubnetEvm = EVM // Alias for backward compatibility BlobVM = "Blob VM" TimestampVM = "Timestamp VM" CustomVM = "Custom" )
const UndefinedNetwork = Undefined
Aliases for compatibility
Variables ¶
This section is empty.
Functions ¶
func GetRPCEndpoint ¶
GetRPCEndpoint returns the RPC endpoint for a given base endpoint and blockchain ID
func GetWSEndpoint ¶
GetWSEndpoint returns the WebSocket endpoint for a given base endpoint and blockchain ID
func HostAnsibleIDToCloudID ¶
HostAnsibleIDToCloudID converts a host Ansible ID to a cloud ID.
func HostCloudIDToAnsibleID ¶
Types ¶
type BaseMigration ¶
type BaseMigration struct {
FromBase string `json:"fromBase"`
ToBase string `json:"toBase"`
ProposalID string `json:"proposalId"`
ExecutedAt int64 `json:"executedAt"`
HotSwap bool `json:"hotSwap"`
CheckpointBlock uint64 `json:"checkpointBlock"`
}
BaseMigration represents a base chain migration
type BridgeRoute ¶
type BridgeRoute struct {
From string `json:"from"`
To string `json:"to"`
Via string `json:"via"` // bridge provider
EstimatedTime int `json:"estimatedTime"` // seconds
EstimatedCost string `json:"estimatedCost"` // in native token
}
BridgeRoute represents a cross-chain route
type CLIDependencyMap ¶
type CLIDependencyMap struct {
RPC int `json:"rpc"`
Luxd map[string]NetworkVersions `json:"luxd"`
SubnetEVM string `json:"subnetevm"`
}
CLIDependencyMap represents CLI dependency versions
type CloudConfig ¶
type CloudConfig map[string]RegionConfig
func (*CloudConfig) GetAPIInstanceIDsForRegion ¶
func (ccm *CloudConfig) GetAPIInstanceIDsForRegion(region string) []string
GetAPIInstanceIDsForRegion returns API instance IDs for specific region
func (*CloudConfig) GetAllAPIInstanceIDs ¶
func (ccm *CloudConfig) GetAllAPIInstanceIDs() []string
GetAllAPIInstanceIDs returns all API instance IDs
func (*CloudConfig) GetAllInstanceIDs ¶
func (ccm *CloudConfig) GetAllInstanceIDs() []string
GetAllInstanceIDs returns all instance IDs
func (*CloudConfig) GetInstanceIDsForRegion ¶
func (ccm *CloudConfig) GetInstanceIDsForRegion(region string) []string
GetInstanceIDsForRegion returns instance IDs for specific region
func (*CloudConfig) GetRegions ¶
func (ccm *CloudConfig) GetRegions() []string
GetRegions returns a slice of strings representing the regions of the RegionConfig.
type ClusterConfig ¶
type ClusterConfig struct {
Nodes []string
APINodes []string
Network Network
MonitoringInstance string // instance ID of the separate monitoring instance (if any)
LoadTestInstance map[string]string // maps load test name to load test cloud instance ID of the separate load test instance (if any)
ExtraNetworkData ExtraNetworkData
Subnets []string
External bool
Local bool
HTTPAccess constants.HTTPAccess
}
func (*ClusterConfig) GetAPIHosts ¶
func (cc *ClusterConfig) GetAPIHosts(hosts []*Host) []*Host
GetAPINodes returns a filtered list of API nodes based on the ClusterConfig and given hosts.
func (*ClusterConfig) GetCloudIDs ¶
func (cc *ClusterConfig) GetCloudIDs() []string
func (*ClusterConfig) GetHostRoles ¶
func (cc *ClusterConfig) GetHostRoles(nodeConf NodeConfig) []string
func (*ClusterConfig) GetValidatorHosts ¶
func (cc *ClusterConfig) GetValidatorHosts(hosts []*Host) []*Host
GetValidatorNodes returns the validator nodes from the ClusterConfig.
func (*ClusterConfig) IsAPIHost ¶
func (cc *ClusterConfig) IsAPIHost(hostCloudID string) bool
func (*ClusterConfig) IsLuxdHost ¶
func (cc *ClusterConfig) IsLuxdHost(hostCloudID string) bool
type ClustersConfig ¶
type ClustersConfigV0 ¶
type ElasticSubnet ¶
type ElasticSubnetConfig ¶
type ElasticSubnetConfig struct {
SubnetID ids.ID
AssetID ids.ID
InitialSupply uint64
MaxSupply uint64
MinConsumptionRate uint64
MaxConsumptionRate uint64
MinValidatorStake uint64
MaxValidatorStake uint64
MinStakeDuration time.Duration
MaxStakeDuration time.Duration
MinDelegationFee uint32
MinDelegatorStake uint64
MaxValidatorWeightFactor byte
UptimeRequirement uint32
}
type ExportCluster ¶
type ExportCluster struct {
ClusterConfig ClusterConfig `json:"clusterConfig"`
Nodes []ExportNode `json:"nodes"`
MonitorNode ExportNode `json:"monitorNode"`
LoadTestNodes []ExportNode `json:"loadTestNodes"`
}
type ExportNode ¶
type ExportNode struct {
NodeConfig NodeConfig `json:"nodeConfig"`
SignerKey string `json:"signerKey"`
StakerKey string `json:"stakerKey"`
StakerCrt string `json:"stakerCrt"`
}
type Exportable ¶
type ExtraNetworkData ¶
type GovernanceProposal ¶
type GovernanceProposal struct {
ID string `json:"id"`
Type string `json:"type"` // base-migration, upgrade, parameter
Title string `json:"title"`
Description string `json:"description"`
L2Name string `json:"l2Name"`
// For base migrations
CurrentBase string `json:"currentBase,omitempty"`
TargetBase string `json:"targetBase,omitempty"`
HotSwap bool `json:"hotSwap,omitempty"`
// Voting
CreatedAt int64 `json:"createdAt"`
VotingEnds int64 `json:"votingEnds"`
Executed bool `json:"executed"`
ExecutedAt int64 `json:"executedAt"`
}
GovernanceProposal for base migrations and upgrades
type Host ¶
type Host struct {
NodeID string
IP string
SSHUser string
SSHPrivateKeyPath string
SSHCommonArgs string
Connection *goph.Client
APINode bool
}
func (*Host) CreateTempDir ¶
CreateTempDir creates a temporary directory on the remote server.
func (*Host) CreateTempFile ¶
CreateTempFile creates a temporary file on the remote server.
func (*Host) Disconnect ¶
func (*Host) ExpandHome ¶
ExpandHome expands the ~ symbol to the home directory.
func (*Host) FileExists ¶
FileExists checks if a file exists on the remote server.
func (*Host) GetAnsibleInventoryRecord ¶
func (*Host) GetCloudID ¶
GetCloudID returns the node ID of the host.
func (*Host) ReadFileBytes ¶
ReadFileBytes downloads a file from the remote server to a byte array
func (*Host) StreamSSHCommand ¶
StreamSSHCommand streams the execution of an SSH command on the host.
func (*Host) UntimedForward ¶
UntimedForward forwards the TCP connection to a remote address. Does not support timeouts on the operation.
func (*Host) UntimedMkdirAll ¶
UntimedMkdirAll creates a folder on the remote server. Does not support timeouts on the operation.
func (*Host) UploadBytes ¶
UploadBytes uploads a byte array to a remote file on the host.
func (*Host) WaitForPort ¶
WaitForPort waits for the SSH port to become available on the host.
type L2Config ¶
type L2Config struct {
Name string `json:"name"`
BaseChain string `json:"baseChain"` // ethereum, lux, lux-l1, op-mainnet
RollupType string `json:"rollupType"` // optimistic, zk, hybrid
DataAvailability string `json:"dataAvailability"` // base, celestia, eigenda
IBCEnabled bool `json:"ibcEnabled"`
PreconfirmEnabled bool `json:"preconfirmEnabled"`
BasedRollup bool `json:"basedRollup"` // true for L1-sequenced
// Contracts
InboxContract string `json:"inboxContract"`
RollupContract string `json:"rollupContract"`
BridgeContract string `json:"bridgeContract"`
// Chain configuration
ChainID uint64 `json:"chainId"`
L1BlockTime int `json:"l1BlockTime"` // milliseconds
// Token info
TokenInfo TokenInfo `json:"tokenInfo"`
CongestionFeeShare int `json:"congestionFeeShare"` // percentage to rollup
// Bridge configuration
EnabledBridges []string `json:"enabledBridges"` // axelar, layerzero, wormhole, etc
IBCChannels []string `json:"ibcChannels"` // IBC channel IDs
// Deployment info
DeployedAt int64 `json:"deployedAt"`
LastMigration int64 `json:"lastMigration"`
}
L2Config represents a based rollup configuration
type L3Config ¶
type L3Config struct {
Name string `json:"name"`
L2Base string `json:"l2Base"` // which L2 is the base
// Inherits most properties from L2Config
L2Config
}
L3Config for nested rollups
type LuxCompatiblity ¶
type LuxdCompatiblity ¶
type LuxdCompatiblity = LuxCompatiblity
LuxdCompatiblity is an alias for backward compatibility
type MigrationTx ¶
type MigrationTx struct {
SubnetID ids.ID `json:"subnetId"`
BlockchainID ids.ID `json:"blockchainId"`
ValidatorManagement string `json:"validatorManagement"`
RentalPlan string `json:"rentalPlan"`
Timestamp int64 `json:"timestamp"`
}
MigrationTx represents a subnet to L1 migration transaction
type MultisigTxInfo ¶
type Network ¶
type Network int64
func GetNetworkFromSidecarNetworkName ¶
GetNetworkFromSidecarNetworkName returns a network based on sidecar network name
func NetworkFromNetworkID ¶
func NetworkFromString ¶
func NewDevnetNetwork ¶
func NewDevnetNetwork() Network
NewDevnetNetwork creates a new Devnet network instance
func NewLocalNetwork ¶
func NewLocalNetwork() Network
NewLocalNetwork creates a new Local network instance
func NewMainnetNetwork ¶
func NewMainnetNetwork() Network
NewMainnetNetwork creates a new Mainnet network instance
func NewTestnetNetwork ¶
func NewTestnetNetwork() Network
NewTestnetNetwork creates a new Testnet network instance
func (Network) BootstrappingContext ¶
BootstrappingContext returns a context for bootstrapping operations
func (Network) CChainEndpoint ¶
CChainEndpoint returns the C-Chain endpoint for the network
func (Network) CChainWSEndpoint ¶
CChainWSEndpoint returns the C-Chain WebSocket endpoint for the network
func (Network) ClusterName ¶
ClusterName returns the cluster name for the network
func (Network) HandlePublicNetworkSimulation ¶
func (Network) NetworkIDFlagValue ¶
func (Network) SDKNetwork ¶
func (s Network) SDKNetwork() interface{}
SDKNetwork returns the network as an SDK network type This is for compatibility with the SDK package
func (Network) WSEndpoints ¶
WSEndpoints returns the WebSocket endpoints for the network
type NetworkData ¶
type NetworkData struct {
SubnetID ids.ID
BlockchainID ids.ID
RPCVersion int
RPCEndpoints []string // RPC endpoints for the network
WSEndpoints []string // WebSocket endpoints for the network
TeleporterRegistryAddress string // Teleporter registry address
TeleporterMessengerAddress string // Teleporter messenger address
ValidatorManagerAddress string // Validator manager contract address
}
type NetworkVersions ¶
type NetworkVersions struct {
LatestVersion string `json:"latestVersion"`
MinimumVersion string `json:"minimumVersion"`
}
NetworkVersions represents versions for a network
type NodeConfig ¶
type NodeConfig struct {
NodeID string // instance id on cloud server
Region string // region where cloud server instance is deployed
AMI string // image id for cloud server dependent on its os (e.g. ubuntu )and region deployed (e.g. us-east-1)
KeyPair string // key pair name used on cloud server
CertPath string // where the cert is stored in user's local machine ssh directory
SecurityGroup string // security group used on cloud server
ElasticIP string // public IP address of the cloud server
CloudService string // which cloud service node is hosted on (AWS / GCP)
UseStaticIP bool // node has a static IP association
IsMonitor bool // node has a monitoring dashboard
IsWarpRelayer bool // node has an Warp relayer service
IsLoadTest bool // node is used to host load test
}
type NodeResult ¶
type NodeResults ¶
type NodeResults struct {
Results []NodeResult
Lock sync.Mutex
}
func (*NodeResults) AddResult ¶
func (nr *NodeResults) AddResult(nodeID string, value interface{}, err error)
func (*NodeResults) GetErrorHostMap ¶
func (nr *NodeResults) GetErrorHostMap() map[string]error
func (*NodeResults) GetErrorHosts ¶
func (nr *NodeResults) GetErrorHosts() []string
func (*NodeResults) GetNodeList ¶
func (nr *NodeResults) GetNodeList() []string
func (*NodeResults) GetResultMap ¶
func (nr *NodeResults) GetResultMap() map[string]interface{}
func (*NodeResults) GetResults ¶
func (nr *NodeResults) GetResults() []NodeResult
func (*NodeResults) HasErrors ¶
func (nr *NodeResults) HasErrors() bool
func (*NodeResults) HasIDWithError ¶
func (nr *NodeResults) HasIDWithError(id string) bool
func (*NodeResults) Len ¶
func (nr *NodeResults) Len() int
type PreconfirmConfig ¶
type PreconfirmConfig struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"` // eigenlayer, builders, bonded
ConfirmationTime int `json:"confirmationTime"` // target ms
CommitteeSize int `json:"committeeSize"`
BondAmount string `json:"bondAmount"` // in LUX
}
PreconfirmConfig represents pre-confirmation settings
type RegionConfig ¶
type Sidecar ¶
type Sidecar struct {
Name string
VM VMType
VMVersion string
RPCVersion int
Subnet string
SubnetID ids.ID
BlockchainID ids.ID
TokenName string
TokenSymbol string
ChainID string
Version string
Networks map[string]NetworkData
ElasticSubnet map[string]ElasticSubnet
ImportedFromLPM bool
ImportedVMID string
// Custom VM support
CustomVMRepoURL string
CustomVMBranch string
CustomVMBuildScript string
// L1/L2 Architecture (2025)
Sovereign bool `json:"sovereign"` // true for L1, false for L2/subnet
BaseChain string `json:"baseChain"` // For L2s: ethereum, lux-l1, lux, op-mainnet
BasedRollup bool `json:"basedRollup"` // true for L1-sequenced rollups
SequencerType string `json:"sequencerType"` // based, centralized, distributed
// Based Rollup Configuration
InboxContract string `json:"inboxContract"` // Contract on base chain
L1BlockTime int `json:"l1BlockTime"` // Base chain block time in ms
PreconfirmEnabled bool `json:"preconfirmEnabled"` // Fast confirmations
// Token & Economics
TokenInfo TokenInfo `json:"tokenInfo"`
RentalPlan string `json:"rentalPlan"` // For L1s: monthly, annual, perpetual
// Validator Management
ValidatorManagement string `json:"validatorManagement"` // proof-of-authority, proof-of-stake
// Migration info
MigratedAt int64 `json:"migratedAt"` // When subnet became L1
// Chain layer (1=L1, 2=L2, 3=L3)
ChainLayer int `json:"chainLayer"` // Default 2 for backward compat
}
func (*Sidecar) NetworkDataIsEmpty ¶
NetworkDataIsEmpty checks if the sidecar has no network data
type SubnetValidator ¶
type SubnetValidator struct {
NodeID string `json:"NodeID"`
Weight uint64 `json:"Weight"`
Balance uint64 `json:"Balance"`
BLSPublicKey string `json:"BLSPublicKey"`
BLSProofOfPossession string `json:"BLSProofOfPossession"`
ChangeOwnerAddr string `json:"ChangeOwnerAddr"`
ValidationID string `json:"ValidationID"`
}