Rust SDK
Overview of the official Lumera Rust SDK for server-side and CLI applications.
Overview
The Rust SDK is the official SDK for building high-performance server-side applications, CLI tools, and system-level integrations with Lumera Protocol. It communicates with the chain over gRPC and routes file operations through SN-API Supernode REST gateway.
Installation
Requirements: Rust stable (edition 2021+).
Architecture
The Rust SDK is organized into three core modules:
| Module | Purpose |
|---|---|
chain | On-chain operations: action parameters, fee lookups, transaction build/sign/broadcast, gas simulation |
snapi | SN-API interaction: upload, download, status polling, file retrieval |
cascade | High-level orchestration: deterministic payload/ID generation, ticket registration, upload/download workflows |
Client Setup
Configure via environment variables or explicit config:
Or use environment variables:
Environment Variables
The SDK's built-in defaults assume you are running a local devnet. For testnet, override them in a .env file or shell environment:
| Variable | Testnet Value | Purpose |
|---|---|---|
LUMERA_CHAIN_ID | lumera-testnet-2 | Chain identifier |
LUMERA_GRPC | https://grpc.testnet.lumera.io | gRPC endpoint |
LUMERA_RPC | https://rpc.testnet.lumera.io | RPC endpoint |
LUMERA_REST | https://lcd.testnet.lumera.io | REST/LCD endpoint |
SNAPI_BASE | https://snapi.testnet.lumera.io | SN-API server base URL |
LUMERA_GAS_PRICE | 0.025ulume | Gas price |
Derive Signing Keys
Both upload and download require a SigningIdentity derived from your mnemonic:
Upload a File
Uploads happen in two steps: register the action on-chain, then stream the file to SN-API.
Download a File
Key Dependencies
cosmrsCosmos SDK signing and gRPCreqwestHTTP client with rustlstokioAsync runtimeblake3File integrity verificationprostProtobuf encoding