Although the Vagrant environment is optional, it is highly recommended for development.
i.e. we can use Python & the ledgerblue CLI, but using Vagrant keeps the host system safe from unwanted modification and ensures code portability.
The projects src/
, example/
, and glyphs/
folders are configured to sync with the Vagrant shell, so any changes to files in those directories will be updated to the development environment accordingly.
At this time, the rebuild script and the Makefile do not sync. Modifying those files requires calling vagrant halt && vagrant up --provision
from outside the shell.
- Ledger Nano S
- Vagrant
- VirtualBox
- Download and run the installer for VirtualBox
6.0.14
:
https://download.virtualbox.org/virtualbox/6.0.14/VirtualBox-6.0.14-133895-Linux_amd64.run
- Download and install the Oracle VM VirtualBox Extension Pack
6.0.14
:
https://download.virtualbox.org/virtualbox/6.0.14/Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
- Download and run the Vagrant
2.2.6
installer:
https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_linux_amd64.zip
System-specific packages can be found at the following links:
https://www.virtualbox.org/wiki/Download_Old_Builds_6_0
https://www.vagrantup.com/downloads.html
- Download and run the installer for VirtualBox
6.0.14
:
https://download.virtualbox.org/virtualbox/6.0.14/VirtualBox-6.0.14-133895-OSX.dmg
- Download and install the Oracle VM VirtualBox Extension Pack
6.0.14
:
https://download.virtualbox.org/virtualbox/6.0.14/Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
- Download and run the Vagrant
2.2.6
installer:
https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.dmg
- Download and run the installer:
https://download.virtualbox.org/virtualbox/6.0.10/VirtualBox-6.0.10-132072-Win.exe
- Download and install the Oracle VM VirtualBox Extension Pack:
https://download.virtualbox.org/virtualbox/6.0.10/Oracle_VM_VirtualBox_Extension_Pack-6.0.10.vbox-extpack
- Download and run the Vagrant installer:
https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.msi
note:
Vagrant on Windows requires using PowerShell.
VSCode also uses Windows Powershell as its default terminal;
it is the recommended development environment.
vagrant up
note: setup will take a few minutes to provision.
vagrant ssh
USB Port locked out of the host machine:
- Try restarting the Vagrant Box from outside the shell.
vagrant halt && vagrant up
Ledger not found in the Vagrant Box:
- On Ubuntu, if the Ledger is not found in the vagrant box, ensure that the host user belongs to the vboxusers group.
sudo usermod -aG vboxusers <username>
(see askubuntu.com/How to set up USB for VirtualBox)
- Try another USB Cable. Prefer the Ledger-supplied cable. Not all USB cables are created equal; and though rare, compromised cables have been found in the wild.
Connect the Ledger device in before flashing.
The Build and Flash commands are executed from project root:
Vagrant Shell: ~/apps/ledger-app-ark
bash ./scripts/rebuild.sh
bash ./scripts/rebuild.sh -x
Along the way, debugging can save a lot of headaches when developing for embedded environments like Ledger.
Specifically, Debugging on Ledger allows:
- Use of PRINTF and Console printing.
- Custom Certificates.
- Session Pin-bypass.
See the following for more information on setting up debugging:
*Be sure to also enable Debugging in the projects Makefile:
# DEBUG = 0
DEBUG = 1