mirror of
https://github.com/luxfi/sdk.git
synced 2026-10-30 15:19:23 +00:00
7.6 KiB
7.6 KiB
SDK Documentation
Table of Contents
- blockchain
- constants
- warp
- key
- keychain
- ledger
- multisig
- network
- publicarchive
- utils
- validator
- validatormanager
- vm
- wallet
blockchain
Functions
New
func New(networkParams *NetworkParams) (*Network, error)
TestNetworkDeploy
func TestNetworkDeploy(t *testing.T)
TestNetworkDeployLedger
func TestNetworkDeployLedger(t *testing.T)
TestNetworkDeployMultiSig
func TestNetworkDeployMultiSig(t *testing.T)
createEvmGenesis
func createEvmGenesis(
evmParams *EVMParams,
) ([]byte, error)
getDefaultEVMGenesis
func getDefaultEVMGenesis() (NetworkParams)
vmID
func vmID(vmName string) (ids.ID, error)
constants
Functions
warp
Functions
NewSignatureAggregator
func NewSignatureAggregator(
network network.Network,
logger logging.Logger,
networkID 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,
networkID 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, networkID 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, networkID 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, networkID ids.ID, nodeID ids.NodeID) (bool, error)
validatormanager
Functions
GetPChainNetworkToL1ConversionMessage
func GetPChainNetworkToL1ConversionMessage(
network network.Network,
aggregatorLogger logging.Logger,
aggregatorQuorumPercentage uint64,
aggregatorAllowPrivateIPs bool,
aggregatorExtraPeerEndpoints []info.Peer,
networkID ids.ID,
managerBlockchainID ids.ID,
managerAddress common.Address,
convertNetworkValidators []*txs.ConvertNetworkToL1Validator,
) (*warp.Message, error)
InitializeValidatorsSet
func InitializeValidatorsSet(
rpcURL string,
managerAddress common.Address,
privateKey string,
networkID ids.ID,
managerBlockchainID ids.ID,
convertNetworkValidators []*txs.ConvertNetworkToL1Validator,
networkConversionSignedMessage *warp.Message,
) (*types.Transaction, *types.Receipt, error)
PoAValidatorManagerInitialize
func PoAValidatorManagerInitialize(
rpcURL string,
managerAddress common.Address,
privateKey string,
networkID ids.ID,
ownerAddress common.Address,
) (*types.Transaction, *types.Receipt, error)
PoSValidatorManagerInitialize
func PoSValidatorManagerInitialize(
rpcURL string,
managerAddress common.Address,
privateKey string,
networkID [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)