Lux Docs

Go SDK

Go client library for Lux Network

The Go SDK (github.com/luxfi/sdk) provides native Go types and functions for interacting with all Lux chain types. It wraps the Lux node RPC APIs and provides wallet, key management, and transaction building utilities.

Installation

go get github.com/luxfi/sdk@latest

Quick Start

package main

import (
    "context"
    "fmt"

    "github.com/luxfi/sdk"
    "github.com/luxfi/sdk/config"
)

func main() {
    cfg := config.Default()
    cfg.Network.Endpoint = "https://api.lux.network/mainnet"

    client, err := sdk.New(cfg)
    if err != nil {
        panic(err)
    }

    // Launch a local test network
    net, err := client.LaunchNetwork(context.Background(), "local", 5)
    if err != nil {
        panic(err)
    }
    fmt.Println("Network ID:", net.ID)
}

Core Packages

PackageImportPurpose
sdkgithub.com/luxfi/sdkTop-level client, network and blockchain operations
walletgithub.com/luxfi/sdk/walletUTXO and EVM wallet with multi-chain signing
keygithub.com/luxfi/sdk/keyEd25519, BLS, and secp256k1 key management
networkgithub.com/luxfi/sdk/networkNetwork lifecycle (create, start, stop, delete)
blockchaingithub.com/luxfi/sdk/blockchainBlockchain creation and deployment
configgithub.com/luxfi/sdk/configSDK and network configuration

Dependencies

The SDK uses only luxfi/* packages for all blockchain operations:

  • github.com/luxfi/crypto -- Cryptographic primitives
  • github.com/luxfi/ids -- ID types (NodeID, BlockchainID, etc.)
  • github.com/luxfi/geth -- EVM interaction
  • github.com/luxfi/warp -- Cross-chain messaging

On this page