Estimated reading time: 5 minutes
Warning
The Nano X does not support side loading, therefore you must use the device emulator Speculos for loading to work. See how to install and use it. For the Nano S and Nano S Plus, you can read the following instructions.
Important
If you are a Mac or a Windows user, you should use a Linux Virtual Machine to load the application to a Nano S or Nano S Plus.
1. Define the udev rules
If you wish to load applications on your device, you will need to add the appropriate udev
rules.
wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash
2. Load the application from inside the container image
Important
If you want to load and delete the app directly from the container image. You need to compile the application, in the source file of your application, adding the --privileged
option:
$ sudo docker run --rm -ti -v "/dev/bus/usb:/dev/bus/usb" -v "$(realpath .):/app"
--privileged ledger-app-builder:latest
While the container image is running:
- Plug and unlock the Nano S or S Plus.
- Use
make load
(BOLOS_SDK=$NANOSP_SDK make load
for the S Plus) to load the app to the Nano S and make delete
to delete it.
- You can exit the image, with the command
exit
.
2. … or load the application with ledgerblue
2.1. Install ledgerblue
ledgerblue
is a package that contains Python tools to communicate with Ledger devices and manage applications life cycle. It is recommended to install this package in a Virtual Environment in your native environment (not a Docker image) to avoid hidapi issues.
Prerequisited packages
First, make sure you have installed the prerequisited packages:
- libudev-dev
- libusb-1.0-0-dev
- python-dev (python 2.7)
- virtualenv
ledgerblue package
Outside of your application folder, install the ledgerblue package in a virtual environment:
virtualenv ledger
source ledger/bin/activate
pip install ledgerblue
deactivate
2.2. Load and delete
Clone the SDK
Important
The Nano S or S Plus SDK must first be locally cloned and stored in BOLOS_SDK
for the loading to work.
Use the following commands for the Nano S:
git clone https://github.com/LedgerHQ/nanos-secure-sdk.git nanos-secure-sdk
export BOLOS_SDK=<path-to>nanos-secure-sdk
For the Nano S Plus:
git clone https://github.com/LedgerHQ/nanos-secure-sdk.git nanosplus-secure-sdk
export BOLOS_SDK=<path-to>nanosplus-secure-sdk
How-to
- Plug and unlock the Nano S or Nano S Plus.
- Move to the root of the application file and activate the virtual environment with
source ledger/bin/activate
.
- Use
make load
to load the app to the Nano S or Nano S Plus and make delete
to delete it.
- You can deactivate the virtual environment with the command
deactivate
.
Note
Before loading an application, make sure you have enough space on the device.