VeChain wallet application framework for Ledger Nano S/SP/X and Stax
Follow the steps of Quick start guide of app-boilerplate reported below just for the sake of completeness.
You can quickly setup a convenient environment to build and test your application by using Ledger's VSCode developer tools extension which leverages the ledger-app-dev-tools docker image.
It will allow you, whether you are developing on macOS, Windows or Linux to quickly build your apps, test them on Speculos and load them on any supported device.
app-boilerplate
with git clone git@github.com:LedgerHQ/app-boilerplate.git
.app-boilerplate
folder with VSCode.ctrl + shift + b
(command + shift + b
on a Mac) to conveniently execute actions :
Build
.Run with Speculos
.:information_source: The terminal tab of VSCode will show you what commands the extension runs behind the scene.
The ledger-app-dev-tools docker image contains all the required tools and libraries to build, test and load an application.
You can download it from the ghcr.io docker repository:
sudo docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
You can then enter this development environment by executing the following command from the directory of the application git
repository:
Linux (Ubuntu)
sudo docker run --rm -ti --user "$(id -u):$(id -g)" --privileged -v "/dev/bus/usb:/dev/bus/usb" -v "$(realpath .):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
macOS
sudo docker run --rm -ti --user "$(id -u):$(id -g)" --privileged -v "$(pwd -P):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
Windows (with PowerShell)
docker run --rm -ti --privileged -v "$(Get-Location):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
The application's code will be available from inside the docker container, you can proceed to the following compilation steps to build your app.
Supposing you have followed the steps of the previous section with VSCode, you can now build and test the application with ease thanks to the Ledger extension. The steps should be:
Docker Container > Update container
Select target
for the desired target.Build > Build
to build the application and app.elf
file (used by Speculos).Functional Tests > Run tests
to test the applicationManually run with Speculos. Once you have the Speculos installed, you can run the application with the following command:
/speculos$ ./speculos.py --api-port 5000 --model nanos --display headless <app-vechain-location>/build/nanos/bin/app.elf
It's possible to generate the transaction and the APDU codes for the transaction by running tests/generatetx.py
script with desired args or directly changing the body of the transaction there.
If you encounter any issue with APDU codes generated by tests/generatetx.py
try by extracting APDU codes from the test suite.
tests/test_sign_tx_long_cmd.py
and run the test.