14 stable releases

new 1.8.0 Mar 17, 2025
1.6.0 Jan 3, 2025
1.5.1 Jul 30, 2024
1.3.0 Feb 5, 2024
1.1.0 Sep 20, 2023

#551 in Cargo plugins

Download history 1/week @ 2024-11-25 27/week @ 2024-12-02 40/week @ 2024-12-09 32/week @ 2024-12-16 144/week @ 2024-12-30 66/week @ 2025-01-06 68/week @ 2025-01-13 13/week @ 2025-01-20 34/week @ 2025-01-27 55/week @ 2025-02-03 25/week @ 2025-02-10 177/week @ 2025-02-17 37/week @ 2025-02-24 107/week @ 2025-03-03 69/week @ 2025-03-10

391 downloads per month

Apache-2.0

24KB
506 lines

cargo-ledger

Dynamic TOML Badge

Builds a Ledger device embedded app and outputs a JSON/TOML manifest file that can be used by ledgerctl to install an application directly on a device.

In order to build for Nano X, Nano S Plus, Stax and Flex custom target files are used. They can be found at the root of the ledger_secure_sdk_sys and can be installed automatically with the command cargo ledger setup.

Installation

This program requires:

Install this repo with:

cargo install --git https://github.com/LedgerHQ/ledger-device-rust-sdk cargo-ledger 

or download it manually and install with:

cargo install --path cargo-ledger

Note that cargo's dependency resolver may behave differently when installing, and you may end up with errors. In order to fix those and force usage of the versions specified in the tagged Cargo.lock, append --locked to the above commands.

Usage

General usage is displayed when invoking cargo ledger.

Setup

This will install custom target files from the SDK directly into your environment.

cargo ledger setup

Building

cargo ledger build nanox
cargo ledger build nanosplus
cargo ledger build stax
cargo ledger build flex

Loading on device can optionally be performed by appending --load or -l to the command.

By default, this program will attempt to build the current program with in release mode (full command: cargo build --release --target=nanosplus --message-format=json)

Arguments can be passed to modify this behaviour after inserting a -- like so:

cargo ledger build nanosplus --load -- --features one -Z unstable-options --out-dir ./output/

Dependencies

~2.8–4MB
~71K SLoC