forked from LedgerHQ/app-nimiq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request LedgerHQ#6 from nimiq/develop
Nimiq App Version 2.0
- Loading branch information
Showing
770 changed files
with
5,531 additions
and
3,104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build and run functional tests using ragger through reusable workflow | ||
|
||
# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation. | ||
# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the | ||
# resulting binaries. | ||
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary. | ||
# | ||
# While this workflow is optional, having functional testing on your application is mandatory and this workflow and | ||
# tooling environment is meant to be easy to use and adapt after forking your application | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
build_application: | ||
name: Build application using the reusable workflow | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | ||
with: | ||
upload_app_binaries_artifact: "compiled_app_binaries" | ||
|
||
ragger_tests: | ||
name: Run ragger tests using the reusable workflow | ||
needs: build_application | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 | ||
with: | ||
download_app_binaries_artifact: "compiled_app_binaries" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main", "master", "develop"] | ||
pull_request: | ||
branches: ["main", "master", "develop"] | ||
# Excluded path: add the paths you want to ignore instead of deleting the workflow | ||
paths-ignore: | ||
- '.github/workflows/*.yml' | ||
- 'tests/*' | ||
|
||
jobs: | ||
analyse: | ||
name: Analyse | ||
strategy: | ||
matrix: | ||
sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK" ] | ||
#'cpp' covers C and C++ | ||
language: [ 'cpp' ] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest | ||
|
||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: security-and-quality | ||
|
||
# CodeQL will create the database during the compilation | ||
- name: Build | ||
run: | | ||
make BOLOS_SDK=${{ matrix.sdk }} | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
build | ||
bin | ||
debug | ||
dep | ||
obj | ||
src/glyphs.c | ||
src/glyphs.h | ||
.idea | ||
nano-sdk | ||
blue-sdk | ||
|
||
# Temporary directory with snapshots taken during test runs | ||
tests/snapshots-tmp/ | ||
|
||
# Output folder of clang static analyzer scan-build, see Makefile.rules-generic in Ledger SDK | ||
output-scan-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
# Nimiq app for the Ledger Nano S and Ledger Blue | ||
# Nimiq app for Ledger devices | ||
|
||
## Introduction | ||
|
||
This is a wallet app for the [Ledger Nano S](https://www.ledgerwallet.com/products/ledger-nano-s) and [Ledger Blue](https://www.ledgerwallet.com/products/ledger-blue) that makes it possible to store your [Nimiq](https://nimiq.com/)-based assets on those devices. | ||
This is a device app for the [Ledger Hardware Wallets](https://www.ledger.com/) which makes it possible to store your | ||
[Nimiq token (NIM)](https://nimiq.com/) on those devices (more precisely use the associated private key for NIM related | ||
operations). | ||
|
||
A companion [Javascript library](https://github.com/LedgerHQ/ledgerjs) is available to communicate with this app. | ||
A companion [Javascript library](https://github.com/nimiq/ledger-api) is available to communicate with this app. | ||
|
||
To learn how to use this library you can take look at the [demo project](https://github.com/jeffesquivels/ledgerjs-nimiq). | ||
## Development Setup | ||
|
||
## Building and installing | ||
|
||
To build and install the app on your Nano S or Blue you must set up the Ledger Nano S or Blue build environment. Please follow the Getting Started instructions at the [Ledger Nano S github repository](https://github.com/LedgerHQ/ledger-nano-s). | ||
|
||
Alternatively, you can set up the Vagrant Virtualbox Ledger environment maintained [here](https://github.com/fix/ledger-vagrant). This sets up an Ubuntu virtual machine with the Ledger build environment already set up. Note that if you are on a Mac, at the time of this writing this seems to be the only way to build and load the app. | ||
|
||
The command to compile and load the app onto the device is: | ||
|
||
```$ make load``` | ||
|
||
To remove the app from the device do: | ||
|
||
```$ make delete``` | ||
For build and installation instructions, please refer to: | ||
- The README of the [Ledger Boilerplate App](https://github.com/LedgerHQ/app-boilerplate) | ||
- [Usage instructions of Ledger's VSCode extension](https://marketplace.visualstudio.com/items?itemName=LedgerHQ.ledger-dev-tools) | ||
and the associated [quickstart guide](https://developers.ledger.com/docs/device-app/beginner/vscode-extension), | ||
or the underlying [ledger-app-builder docker images](https://github.com/LedgerHQ/ledger-app-builder/), if you prefer | ||
to use them directly, without the VSCode extension. Here at Nimiq, mainly the docker images have been used directly | ||
for building and testing the application via the [Speculos](https://github.com/LedgerHQ/speculos) emulator, on real | ||
devices and via [Ragger](https://github.com/LedgerHQ/ragger) functional tests. | ||
|
||
## Testing | ||
|
||
The `./test` directory contains files for testing the transaction parser and some printing utilities. To build and execute the tests run `./test.sh`. | ||
|
||
## Key pair validation | ||
The project contains functional tests powered by [Ragger](https://github.com/LedgerHQ/ragger). They can be launched via | ||
the VSCode extension or docker images as described in the section [Development Setup](#development-setup). | ||
|
||
The operation to retrieve the public key implements an optional keypair verification method. Along with the request to retrieve the public key a small message is sent that is to be signed by the device. Back on the host the returned signature can be checked against the returned public key. This is to guard against incompatibility between the keypairs generated by the Ledger device and the ones expected by the Nimiq network, whatever the reason for this might be. The extra precaution prevents users from sending funds to an address they are not able to sign transactions for. | ||
Additionally, the project contains [unit-tests](https://github.com/nimiq/ledger-app-nimiq/tree/master/unit-tests). |
Binary file not shown.
Oops, something went wrong.