Files
2025-07-31 21:28:14 +00:00

7.6 KiB

SDK Documentation

Table of Contents


blockchain

Functions

New

func New(subnetParams *SubnetParams) (*Subnet, error)

TestSubnetDeploy

func TestSubnetDeploy(t *testing.T)

TestSubnetDeployLedger

func TestSubnetDeployLedger(t *testing.T)

TestSubnetDeployMultiSig

func TestSubnetDeployMultiSig(t *testing.T)

createEvmGenesis

func createEvmGenesis(
	subnetEVMParams *SubnetEVMParams,
) ([]byte, error)

getDefaultSubnetEVMGenesis

func getDefaultSubnetEVMGenesis() (SubnetParams)

vmID

func vmID(vmName string) (ids.ID, error)

constants

Functions


interchain

Functions

NewSignatureAggregator

func NewSignatureAggregator(
	network network.Network,
	logger logging.Logger,
	subnetID ids.ID,
	quorumPercentage uint64,
	allowPrivatePeers bool,
	extraPeerEndpoints []info.Peer,
) (*SignatureAggregator, error)

TestSignatureAggregator

func TestSignatureAggregator(t *testing.T)

createAppRequestNetwork

func createAppRequestNetwork(
	network network.Network,
	logger logging.Logger,
	registerer prometheus.Registerer,
	allowPrivatePeers bool,
	extraPeerEndpoints []info.Peer,
) (peers.AppRequestNetwork, error)

initSignatureAggregator

func initSignatureAggregator(
	network peers.AppRequestNetwork,
	logger logging.Logger,
	registerer prometheus.Registerer,
	subnetID ids.ID,
	quorumPercentage uint64,
) (*SignatureAggregator, error)

instantiateAggregator

func instantiateAggregator(t *testing.T) (
	*SignatureAggregator,
	*mocks.MockAppRequestNetwork,
	error,
)

key

Functions

LoadSoft

func LoadSoft(keyPath string) (*SoftKey, error)

LoadSoftFromBytes

func LoadSoftFromBytes(kb []byte) (*SoftKey, error)

LoadSoftOrCreate

func LoadSoftOrCreate(keyPath string) (*SoftKey, error)

NewSoft

func NewSoft(opts ...SOpOption) (*SoftKey, error)

SortTransferableInputsWithSigners

func SortTransferableInputsWithSigners(ins []*lux.TransferableInput, signers [][]ids.ShortID)

TestNewKey

func TestNewKey(t *testing.T)

TestNewKeyEwoq

func TestNewKeyEwoq(t *testing.T)

WithPrivateKey

func WithPrivateKey(privKey *secp256k1.PrivateKey) (SOpOption)

WithPrivateKeyEncoded

func WithPrivateKeyEncoded(privKey string) (SOpOption)

checkKeyFileEnd

func checkKeyFileEnd(r io.ByteReader) (error)

decodePrivateKey

func decodePrivateKey(enc string) (*secp256k1.PrivateKey, error)

encodePrivateKey

func encodePrivateKey(pk *secp256k1.PrivateKey) (string, error)

readASCII

func readASCII(buf []byte, r io.ByteReader) (n int, err error)

keychain

Functions

NewKeychain

func NewKeychain(
	network network.Network,
	keyPath string,
	ledgerInfo *LedgerParams,
) (*Keychain, error)

ledger

Functions

New

func New() (*LedgerDevice, error)

multisig

Functions

GetOwners

func GetOwners(network network.Network, subnetID ids.ID) ([]ids.ShortID, uint32, error)

New

func New(pChainTx *txs.Tx) (*Multisig)

network

Functions

TestnetNetwork

func TestnetNetwork() (Network)

MainnetNetwork

func MainnetNetwork() (Network)

NetworkFromNetworkID

func NetworkFromNetworkID(networkID uint32) (Network)

NewNetwork

func NewNetwork(kind NetworkKind, id uint32, endpoint string) (Network)

publicarchive

Functions

NewDownloader

func NewDownloader(
	network network.Network,
	logger logging.Logger,
) (Downloader, error)

TestDownloader_Download

func TestDownloader_Download(t *testing.T)

TestDownloader_EndToEnd

func TestDownloader_EndToEnd(t *testing.T)

TestDownloader_UnpackTo

func TestDownloader_UnpackTo(t *testing.T)

TestNewDownloader

func TestNewDownloader(t *testing.T)

TestNewGetter

func TestNewGetter(t *testing.T)

newGetter

func newGetter(endpoint string, target string) (Getter, error)

utils

Functions

DirExists

func DirExists(dirName string) (bool)

ExpandHome

func ExpandHome(path string) (string)

FileExists

func FileExists(filename string) (bool)

GetAPIContext

func GetAPIContext() (context.Context, context.CancelFunc)

GetAPILargeContext

func GetAPILargeContext() (context.Context, context.CancelFunc)

GetTimedContext

func GetTimedContext(timeout time.Duration) (context.Context, context.CancelFunc)

TestAppendSlices

func TestAppendSlices(t *testing.T)

TestExpandHome

func TestExpandHome(t *testing.T)

TestRetry

func TestRetry(t *testing.T)

Uint32Sort

func Uint32Sort(arr []uint32)

mockFunction

func mockFunction() (interface)

validator

Functions

GetRegisteredValidator

func GetRegisteredValidator(
	rpcURL string,
	managerAddress common.Address,
	nodeID ids.NodeID,
) (ids.ID, error)

GetTotalWeight

func GetTotalWeight(net network.Network, subnetID ids.ID) (uint64, error)

GetValidationID

func GetValidationID(rpcURL string, nodeID ids.NodeID) (ids.ID, error)

GetValidatorBalance

func GetValidatorBalance(net network.Network, validationID ids.ID) (uint64, error)

GetValidatorInfo

func GetValidatorInfo(net network.Network, validationID ids.ID) (platformvm.L1Validator, error)

IsValidator

func IsValidator(net network.Network, subnetID ids.ID, nodeID ids.NodeID) (bool, error)

validatormanager

Functions

GetPChainSubnetToL1ConversionMessage

func GetPChainSubnetToL1ConversionMessage(
	network network.Network,
	aggregatorLogger logging.Logger,
	aggregatorQuorumPercentage uint64,
	aggregatorAllowPrivateIPs bool,
	aggregatorExtraPeerEndpoints []info.Peer,
	subnetID ids.ID,
	managerBlockchainID ids.ID,
	managerAddress common.Address,
	convertSubnetValidators []*txs.ConvertSubnetToL1Validator,
) (*warp.Message, error)

InitializeValidatorsSet

func InitializeValidatorsSet(
	rpcURL string,
	managerAddress common.Address,
	privateKey string,
	subnetID ids.ID,
	managerBlockchainID ids.ID,
	convertSubnetValidators []*txs.ConvertSubnetToL1Validator,
	subnetConversionSignedMessage *warp.Message,
) (*types.Transaction, *types.Receipt, error)

PoAValidatorManagerInitialize

func PoAValidatorManagerInitialize(
	rpcURL string,
	managerAddress common.Address,
	privateKey string,
	subnetID ids.ID,
	ownerAddress common.Address,
) (*types.Transaction, *types.Receipt, error)

PoSValidatorManagerInitialize

func PoSValidatorManagerInitialize(
	rpcURL string,
	managerAddress common.Address,
	privateKey string,
	subnetID [32]byte,
	posParams PoSParams,
) (*types.Transaction, *types.Receipt, error)

vm

Functions


wallet

Functions

New

func New(ctx context.Context, uri string, luxKeychain luxdkeychain.Keychain, config primary.WalletConfig) (Wallet, error)