Giter VIP home page Giter VIP logo

ledger-iov's Introduction

Ledger-IOV

License Build Status

This repository contains the Ledger Nano S app for IOV (BOLOS app and unit tests).

Source code for apps is linked as submodules to allow for Ledger's build infrastructure. For development purposes, this repo is recommended as it includes unit tests, tools, etc.

Installing the release

Warning The only safe and convenient way to install apps on the Leder is via the Ledger Live Store. Those instructions are meant for testers and developers only. We recommend dedicated testing devices.

Prerequisites

  • You run some kind of UNIX-like environment
  • Python3 and venv module installed (check via python3 --version, python3 -m venv --help)
  • A C compiler

Debian/Ubuntu

  1. Ensure to add Universe to your apt repositories sudo apt install build-essential python3-dev python3-venv libusb-1.0-0-dev libudev-dev
  2. wget https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/20-hw1.rules
  3. sudo mv 20-hw1.rules /etc/udev/rules.d/20-hw1.rules
  4. sudo udevadm trigger && sudo udevadm control --reload-rules

MacOS

  1. Install dependencies: brew bundle
  2. Install XCode and XCode command line tools xcode-select --install

Download

Find a recent release from ledger-iov releases that includes a zip package (e.g. iov-testnet-ledger-0.10.0+9.zip). The mainnet/testnet parts in the file name tell you for which network the app works. You can install both apps in parallel.

Download and extract.

Install / Uninstall

  1. Navigate to the extracted folder, e.g. cd ~/Downloads/iov-testnet-ledger
  2. Connect and unlock Ledger Nano S; navigate to the main menu.
  3. To install run ./install_app.sh; to uninstall run ./install_app.sh --uninstall

Further notes

The +xyz suffix in versions is build meta data, i.e. the same Ledger app in a different package

Ledger Nano X support

Right now, there is no support for the Ledger Nano X. However, the source code is prepared for future Nano X support, which is why there are Nano X references in some places.

Building

The following document describes how to build the apps: Build instructions

Specifications

ledger-iov's People

Contributors

webmaster128 avatar jleni avatar orkunkl avatar davepuchyr avatar merge-when-green[bot] avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar Albert Andrejev avatar  avatar Anna Torok avatar  avatar  avatar  avatar

ledger-iov's Issues

Getting "compiling with an SDK that doesn't seem to exist" error

Installation of ledger application release fails on latest osx distributions(MacOSX10.14.sdk) due to a bug in hidapi software.

Here is the error output:

  Compiling with an SDK that doesn't seem to exist: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
  Please check your Xcode installation
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -framework IOKit -framework CoreFoundation -Ihidapi/hidapi -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/iov_ledger_app_install.LnsWGVsIf/iov-ledger/include -I/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c hid.c -o build/temp.macosx-10.14-x86_64-3.7/hid.o
  clang: warning: -framework IOKit: 'linker' input unused [-Wunused-command-line-argument]
  clang: warning: -framework CoreFoundation: 'linker' input unused [-Wunused-command-line-argument]
  clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
  In file included from hid.c:4:
  /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:25:10: fatal error: 'stdio.h' file not found
  #include <stdio.h>
           ^~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1

  ----------------------------------------
  Failed building wheel for hidapi
  Running setup.py clean for hidapi
Failed to build hidapi
Installing collected packages: urllib3, idna, certifi, chardet, requests, hidapi, python-u2flib-host, future, six, protobuf, pycryptodomex, pillow, websocket-client, ecpy, ledgerblue
  Running setup.py install for hidapi ... error
    Complete output from command /private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/iov_ledger_app_install.LnsWGVsIf/iov-ledger/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/pip-install-uo8geo2_/hidapi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/pip-record-vnh_9qgz/install-record.txt --single-version-externally-managed --compile --install-headers /private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/iov_ledger_app_install.LnsWGVsIf/iov-ledger/include/site/python3.7/hidapi:
    running install
    running build
    running build_ext
    skipping 'hid.c' Cython extension (up-to-date)
    building 'hid' extension
    creating build
    creating build/temp.macosx-10.14-x86_64-3.7
    creating build/temp.macosx-10.14-x86_64-3.7/hidapi
    creating build/temp.macosx-10.14-x86_64-3.7/hidapi/mac
    Compiling with an SDK that doesn't seem to exist: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
    Please check your Xcode installation
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -framework IOKit -framework CoreFoundation -Ihidapi/hidapi -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/iov_ledger_app_install.LnsWGVsIf/iov-ledger/include -I/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c hid.c -o build/temp.macosx-10.14-x86_64-3.7/hid.o
    clang: warning: -framework IOKit: 'linker' input unused [-Wunused-command-line-argument]
    clang: warning: -framework CoreFoundation: 'linker' input unused [-Wunused-command-line-argument]
    clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
    In file included from hid.c:4:
    /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:25:10: fatal error: 'stdio.h' file not found
    #include <stdio.h>
             ^~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/iov_ledger_app_install.LnsWGVsIf/iov-ledger/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/pip-install-uo8geo2_/hidapi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/pip-record-vnh_9qgz/install-record.txt --single-version-externally-managed --compile --install-headers /private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/iov_ledger_app_install.LnsWGVsIf/iov-ledger/include/site/python3.7/hidapi" failed with error code 1 in /private/var/folders/wj/0r7t6rjs7kq_vgktqcqfxj6c0000gn/T/pip-install-uo8geo2_/hidapi/

You can follow the current progress of the issue on:

Add missing docs

The docs referenced in the README.md

- [APDU Protocol](https://github.com/zondax/ledger-iov/tree/master/docs/APDUSPEC.md)
- [Transaction format](https://github.com/zondax/ledger-iov/tree/master/docs/TXSPEC.md)
- [User interface](https://github.com/zondax/ledger-iov/tree/master/docs/UISPEC.md)

are missing in this repo

Error on ubuntu with version v0.10.0+6

When I ran ./install.sh from v0.10.0+6 first I got this error:

Complete output from command /tmp/iov_ledger_app_install.7CSapOcEB/iov-ledger/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-vyv_grfy/hidapi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-5znerfx6-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/iov_ledger_app_install.7CSapOcEB/iov-ledger/include/site/python3.6/hidapi:
    running install
    running build
    running build_ext
    cythoning hid.pyx to hid.c
    /tmp/pip-build-vyv_grfy/hidapi/.eggs/Cython-0.29.13-py3.6-linux-x86_64.egg/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a
later release! File: /tmp/pip-build-vyv_grfy/hidapi/hid.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    building 'hid' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/hidapi
    creating build/temp.linux-x86_64-3.6/hidapi/libusb
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/tmp/iov_ledger_app_install.7CSapOcEB/iov-ledger/include -I/usr/include/python3.6m -c hid.c -o build/temp.linux-x86_64-3.6/hid.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/tmp/iov_ledger_app_install.7CSapOcEB/iov-ledger/include -I/usr/include/python3.6m -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-3.6/hidapi/libusb/hid.o
    hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
     #include <libusb.h>
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/tmp/iov_ledger_app_install.7CSapOcEB/iov-ledger/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-vyv_grfy/hidapi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-5znerfx6-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/iov_ledger_app_install.7CSapOcEB/iov-ledger/include/site/python3.6/hidapi" failed with error code 1 in /tmp/pip-build-vyv_grfy/hidapi/

installing libusb via sudo apt install libusb-1.0-0-dev solved the problem yet when I ran the script again new error:

Complete output from command /tmp/iov_ledger_app_install.7JGz4CCKp/iov-ledger/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-v30l9r2y/hidapi/setup.py';f=getattr(tokenize, 'open', ope
n)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-mb7te1k2-record/install-record.txt --single-version-externally-managed --compile --inst
all-headers /tmp/iov_ledger_app_install.7JGz4CCKp/iov-ledger/include/site/python3.6/hidapi:
    running install
    running build
    running build_ext
    cythoning hid.pyx to hid.c
    /tmp/pip-build-v30l9r2y/hidapi/.eggs/Cython-0.29.13-py3.6-linux-x86_64.egg/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a
later release! File: /tmp/pip-build-v30l9r2y/hidapi/hid.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    building 'hid' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/hidapi
    creating build/temp.linux-x86_64-3.6/hidapi/libusb
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/tmp
/iov_ledger_app_install.7JGz4CCKp/iov-ledger/include -I/usr/include/python3.6m -c hid.c -o build/temp.linux-x86_64-3.6/hid.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/tmp
/iov_ledger_app_install.7JGz4CCKp/iov-ledger/include -I/usr/include/python3.6m -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-3.6/hidapi/libusb/hid.o
    creating build/lib.linux-x86_64-3.6
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security
 -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/hid.o build/temp.linux-x86_64-3.6/hidapi/libusb/hid.o -lusb-1.0 -ludev -lrt -o build/lib.linux-x86_64-3.6/hid.cpython-36m-x86_64-linux-gnu.so
    /usr/bin/ld: cannot find -ludev
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/tmp/iov_ledger_app_install.7JGz4CCKp/iov-ledger/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-v30l9r2y/hidapi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read
().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-mb7te1k2-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/iov_led
ger_app_install.7JGz4CCKp/iov-ledger/include/site/python3.6/hidapi" failed with error code 1 in /tmp/pip-build-v30l9r2y/hidapi/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.