Lux SDKGoPackages

models

Package models provides data structures and types used throughout the SDK.

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

Package models provides data structures and types used throughout the SDK.

Copyright (C) 2022, Lux Partners Limited All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022, Lux Partners Limited All rights reserved. See the file LICENSE for licensing terms.

Functions

GetRPCEndpoint

func GetRPCEndpoint(baseEndpoint string, blockchainID string) string

GetRPCEndpoint returns the RPC endpoint for a given base endpoint and blockchain ID

GetWSEndpoint

func GetWSEndpoint(baseEndpoint string, blockchainID string) string

GetWSEndpoint returns the WebSocket endpoint for a given base endpoint and blockchain ID

HostAnsibleIDToCloudID

func HostAnsibleIDToCloudID(hostAnsibleID string) (string, string, error)

HostAnsibleIDToCloudID converts a host Ansible ID to a cloud ID.

HostCloudIDToAnsibleID

func HostCloudIDToAnsibleID(cloudService string, hostCloudID string) (string, error)

NewHostConnection

func NewHostConnection(h *Host, port uint) (*goph.Client, error)

Types

BaseMigration

BaseMigration represents a base chain migration

BridgeRoute

BridgeRoute represents a cross-chain route

CLIDependencyMap

CLIDependencyMap represents CLI dependency versions

ChainValidator

ChainValidator is a backward compatibility alias for Validator.

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

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

ClustersConfig

ClustersConfigV0

ElasticChain

ElasticChainConfig

ElasticNet

ElasticNet is an alias for ElasticChain (deprecated)

ElasticNetConfig

ElasticNetConfig is an alias for backward compatibility (deprecated)

ExportCluster

ExportNode

Exportable

ExtraNetworkData

GCPConfig

GenesisParams

GenesisParams represents network genesis parameters

GovernanceProposal

GovernanceProposal for base migrations and upgrades

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

L2Config

L2Config represents a based rollup configuration

L3Config

L3Config for nested rollups

LuxCompatiblity

LuxdCompatiblity

LuxdCompatiblity is an alias for backward compatibility

MigrationTx

MigrationTx represents a chain to L1 migration transaction

MultisigTxInfo

Network

func ConvertClusterToNetwork(network Network) Network
func GetNetworkFromSidecarNetworkName(name string) Network
func NetworkFromNetworkID(networkID uint32) Network
func NetworkFromString(s string) Network
func NewDevnetNetwork() Network
func NewLocalNetwork() Network
func NewMainnetNetwork() Network
func NewNetworkFromCluster(network Network, clusterName string) Network
func NewTestnetNetwork() Network
func (s Network) BlockchainEndpoint(blockchainID string) string
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) GenesisParams() *GenesisParams
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

NetworkData

NetworkVersions

NetworkVersions represents versions for a network

NodeConfig

NodeResult

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

PermissionlessValidators

PreconfirmConfig

PreconfirmConfig represents pre-confirmation settings

RegionConfig

Sidecar

func (sc Sidecar) GetVMID() (string, error)
func (sc *Sidecar) NetworkDataIsEmpty() bool

TokenInfo

VMCompatibility

VMType

func VMTypeFromString(s string) VMType
func (v VMType) Org() string
func (v VMType) RepoName() string

Validator

Validator represents a validator on any network layer (primary, L1, L2, L3) As above, so below - validators are unified across all network layers