Crates.io | nanos_sdk |
lib.rs | nanos_sdk |
version | 0.2.1 |
source | src |
created_at | 2023-09-25 17:47:56.448031 |
updated_at | 2023-09-25 17:47:56.448031 |
description | Rust SDK for Ledger device applications |
homepage | |
repository | https://github.com/LedgerHQ/ledger-nanos-sdk |
max_upload_size | |
id | 982924 |
size | 4,787,461 |
Crate that allows developing Ledger Nano apps in Rust with a default configuration.
Contains:
This SDK is incomplete in the sense that wrappers are currently missing, and not all wrappers have a nice Rust abstraction on top, but two apps were made using it:
You can submit an issue or even a pull request if you wish to contribute, we will check what we can do.
Nano S | Nano X | Nano S Plus |
---|---|---|
:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Building requires adding rust-src
to your Rust installation, and both Clang and arm-none-eabi-gcc.
On Ubuntu, gcc-multilib
might also be required.
Using rustc nightly builds is mandatory as some unstable features are required.
rustup default nightly
rustup component add rust-src
If you wish to install the ARM gcc toolchain using your distribution's packages, these commands should work:
# On Debian and Ubuntu
sudo apt install clang gcc-arm-none-eabi gcc-multilib
# On Fedora or Red Hat Entreprise Linux
sudo dnf install clang arm-none-eabi-gcc arm-none-eabi-newlib
# On ArchLinux
sudo pacman -S clang arm-none-eabi-gcc arm-none-eabi-newlib
This SDK provides three custom target files for Nano S, Nano X and Nano S+.
cargo build --release -Z build-std=core --target=./nanos.json
cargo build --release -Z build-std=core --target=./nanox.json
cargo build --release -Z build-std=core --target=./nanosplus.json
Building before rustc 1.54 should fail with error[E0635]: unknown feature const_fn_trait_bound
.
This is solved by activating a specific feature: cargo build --features pre1_54
Make sure you've followed the installation steps above. In order for your PR to be accepted, it will have to pass the CI, which performs the following checks:
clippy
does not emit any warningsrustfmt
's format (using cargo fmt
)