Apart from cloning, be sure you get all the submodules, by calling:
git submodule update --init --recursive
This project requires ledger firmware 1.5.5
The current repository keeps track of Ledger's SDK but it is possible to override it by changing the git submodule.
Please install docker CE. The instructions can be found here: https://docs.docker.com/install/
Install the following packages:
sudo apt update && apt-get -y install build-essential git wget cmake libssl-dev libgmp-dev autoconf libtool
It is recommended that you install brew and xcode.
Additionally you will need to:
brew bundle
The unversioned python
and pip
commands need to point to Python 3 versions. This is unconvenient
but something we cannot easily change due to external code and scripts.
Setup a Python 3 development environment as follows:
- Install Python 3:
brew install python
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
- In zsh only:
rehash
- Install Python 3:
sudo apt-get install -y python3 python3-pip
export PATH="$PWD/scripts/python3-ubuntu:$PATH"
- In zsh only:
rehash
In most cases, make deps
should be able to install all dependencies:
make deps
(Ledger firmware 1.5.5 requires python 3 and ledgerblue >= 0.1.21. )
In order to keep builds reproducible, a Makefile is provided.
The Makefile will build the firmware in a docker container and leave the binary in the correct directory.
The following command will build the app firmware inside a container. All output will be available to the host.
make # Builds the app
The following command will upload the application to the ledger. Warning: The application will be deleted before uploading.
make load # Builds and loads the app to the device
The app is built for mainnet by default. To enable the testnet mode, set
the environment variable TESTNET_ENABLED
. E.g.
TESTNET_ENABLED=1 make build
TESTNET_ENABLED=1 make load
This is useful when you want to make changes to libraries, run unit tests, etc. It will build all common libraries and unit tests.
cmake -DDISABLE_DOCKER_BUILDS=ON . && make
export GTEST_COLOR=1 && ctest -VV