Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Lumera Rust SDK (lumera-sdk-rs)
Official Rust SDK for integrating with Lumera chain actions and Cascade flows via sn-api-server.
This SDK covers the full action lifecycle used by apps and services:
- register ticket on-chain
- upload file via
sn-api-server - request and download file
- verify integrity by hash
Table of Contents
- What this SDK provides
- Requirements
- Installation
- Configuration
- Quick start
- Golden test (what it means)
- Local developer commands (Makefile)
- CI gates
- Contributing / PR checklist
What this SDK provides
lumera-sdk-rs exposes 3 layers:
-
Chain client (
chain)- action params + fee lookup
- account info lookup
- action registration transaction flow
- generic tx build/sign/broadcast utilities
- tx gas simulation helper + adjusted gas signing flow
- tx confirmation lookup/wait helpers
-
sn-api client (
snapi)- start upload
- poll upload/download status
- request download + fetch output file
-
High-level SDK (
cascade)- deterministic payload/ID generation
- register ticket on-chain
- upload/download orchestration through
sn-api-server
Also included:
- config loading from env,
.env,.toml,.jsonviaconfig::SdkSettings - runnable end-to-end example:
examples/golden_devnet.rs
Requirements
- Rust stable (1.75+ recommended)
- Reachable Lumera endpoints (REST/RPC/gRPC)
- Reachable
sn-api-server - Signing keys for:
- chain tx signing (
cosmrs::crypto::secp256k1::SigningKey) - arbitrary payload signing (
k256::ecdsa::SigningKey)
- chain tx signing (
Installation
From crates.io (from the first release, 0.1.0):
or in Cargo.toml:
[]
= "0.1"
From a release's source: each release in LumeraProtocol/releases carries sdk-rs-vX.Y.Z-src.tar.gz; unpack it and depend on it by path:
[]
= { = "../sdk-rs-vX.Y.Z" }
Issues: LumeraProtocol/releases (label sdk-rs).
How a release is made
versioninCargo.tomlis set to the new version.- A signed tag
vX.Y.Z(git tag -s) on that commit runs.github/workflows/release.yml: it exports the publishable tree (scripts/export.sh,.release/allow), runs the tests andcargo packagein that export, and attaches the source tarball withSHA256SUMSto a private draft Release. - The draft is reviewed and published to
LumeraProtocol/releasesand crates.io with release-kit'sshelf-publish.sh. Nothing becomes public before that step.
Configuration
Supported configuration styles:
- explicit in code (
CascadeConfig,ChainConfig) - environment variables (
SdkSettings::from_env()) - config file (
SdkSettings::from_file("*.toml|*.json")) .envfile (SdkSettings::from_env_file(".env"))
Common env vars:
LUMERA_CHAIN_IDLUMERA_GRPCLUMERA_RPCLUMERA_RESTLUMERA_GAS_PRICESNAPI_BASE
Quick start
See:
examples/golden_devnet.rs(full E2E register/upload/download/hash)examples/from_env_settings.rs(load config from env + construct SDK)examples/custom_config.rs(explicit in-code endpoint config)examples/README.md(examples index)
golden_devnet.rs executes full flow:
- register ticket
- upload
- request download
- download file
- compare hash of original vs downloaded bytes
Simple Browser UI (sdk-rs API)
This repo now includes a minimal browser UI similar to sdk-js/examples/browser, but backed by sdk-rs API handlers:
- UI:
examples/ui/index.html - API server:
examples/ui_server.rs
Run it:
SNAPI_BASE=http://127.0.0.1:8089
Then open:
http://127.0.0.1:3002
Optional env:
SDK_RS_UI_PORT(default3002)SNAPI_BASE(defaulthttp://127.0.0.1:8089)LUMERA_MNEMONIC(required for automatic register/sign flow)LUMERA_CREATOR(sender address; defaults to local dev value if omitted)LUMERA_REST,LUMERA_RPC,LUMERA_GRPC,LUMERA_CHAIN_ID
The UI calls Rust endpoints under /api/*, with no manual action/signature input:
POST /api/workflow/upload(register ticket + sign + start upload)GET /api/upload/{task_id}/summaryPOST /api/workflow/download(uses last uploaded action by default)GET /api/download/{task_id}/summaryGET /api/download/{task_id}/file
Golden test (what it means)
In this repo, golden test means a full-system integration run against a real Lumera + sn-api-server stack, with strict pass criteria:
- action is registered on-chain successfully
- upload task succeeds
- download task succeeds
- downloaded file hash exactly matches original file hash
This is not a unit test and not a mock test. It is an end-to-end correctness gate for protocol compatibility.
Run locally:
make golden calls scripts/run_golden_local.sh and runs cargo run --example golden_devnet.
Required env for local golden run:
LUMERA_MNEMONICLUMERA_CREATOR
Optional (defaults provided):
LUMERA_REST(defaulthttp://127.0.0.1:1317)LUMERA_RPC(defaulthttp://127.0.0.1:26657)LUMERA_GRPC(defaulthttp://127.0.0.1:9090)SNAPI_BASE(defaulthttp://127.0.0.1:8080)LUMERA_CHAIN_ID(defaultlumera-devnet)GOLDEN_INPUT(default/tmp/lumera-rs-golden-input.bin)
Local developer commands (Makefile)
Use these before opening/updating a PR:
High-priority commands:
For CI-parity PR E2E script against public testnet/public sn-api:
- Always runs public endpoint smoke checks.
- Runs full register/upload/download/hash flow when
LUMERA_MNEMONICandLUMERA_CREATORare provided.
CI gates
Current workflows enforce:
Lint + FormatTestDocsSecurity (cargo audit)System E2E (PR, public sn-api):- runs on PR opened/reopened/synchronize
- targets public endpoints (
snapi.testnet.lumera.io, Lumera testnet RPC/REST/gRPC) - executes endpoint smoke checks for all PRs
- executes full register → upload → download → hash match when testnet creds are configured as secrets
- publishes run artifacts/logs
Contributing / PR checklist
Before PR creation and before each push to an open PR:
If your change affects chain/sn-api/cascade behavior, run:
PRs should include:
- clear scope and compatibility notes
- test evidence (at minimum
make check; include golden/e2e evidence where relevant) - no unrelated refactors
Security notes
- never commit mnemonics/private keys
- inject secrets at runtime (env/secret manager)
- use dedicated keys per environment