Skip to content

Commit

Permalink
Merge pull request #8 from blooo-io/docs/LCMWDD-30-1-2-application-ar…
Browse files Browse the repository at this point in the history
…chitecture-doc

Docs/LCMWDD-30-1-2-application-architecture-doc
  • Loading branch information
GuilaneDen authored Nov 26, 2021
2 parents fbbc4ca + eb8af20 commit 62c6fad
Show file tree
Hide file tree
Showing 64 changed files with 341 additions and 329 deletions.
33 changes: 11 additions & 22 deletions _data/navigation_docs_tr.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,43 @@
- title: Overview
- title: Connecting a wallet
docs:
- transport/overview

- title: Connectivity capabilities
docs:
- transport/connectivity-capabilities

- title: Choose the right transport
- title: Transport
docs:
- transport/choose-the-transport

- title: Integration Walkthrough
subfolderitems:
- title: Prerequisites
docs:
- transport/prerequisites
- title: Web Application
docs:
- transport/web-integration
- transport/web-hid-usb
- transport/web-bluetooth

- title: Mobile Application
docs:
- transport/mobile-integration
- transport/react-native-android-hid
- transport/react-native-bluetooth-android
- transport/react-native-bluetooth-ios
- title: Desktop Application
docs:
- transport/desktop-integration
- transport/node-electron-hid

- title: Application Architecture

- title: Architecture
docs:
- transport/connect-wallet
- transport/application-architecture
- transport/architecture-dataflow

- title: Architecture Dataflow
- title: End-2-end Tutorials
docs:
- transport/connect-wallet

- title: End-2-end Tutorial
docs:
- transport/connect-wallet

- title: FAQ
- title: FAQ & Troubleshooting
docs:
- transport/U2F

- title: Troubleshooting
docs:
- transport/connect-wallet
- transport/test-communication



Expand Down
37 changes: 19 additions & 18 deletions _data/navigation_docs_tr_linear.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@
docs:
- transport/overview

- title: Nano calls
- title: Transport
docs:
- transport/nano-api-calls
- transport/nano-api-less-calls
- transport/test-communication
- transport/choose-the-transport

- title: Integration Walkthrough
docs:
- transport/prerequisites
- transport/web-hid-usb
- transport/web-bluetooth
- transport/react-native-android-hid
- transport/react-native-bluetooth-android
- transport/react-native-bluetooth-ios
- transport/node-electron-hid

- title: Examples
- title: Architecture
docs:
- transport/example-webusb-js
- transport/example-webble-react
- transport/example-reactnative-ble
- transport/application-architecture
- transport/architecture-dataflow

- title: Transport APIs
- title: End-2-end Tutorial
docs:
- transport/webhid
- transport/webusb
- transport/web-ble
- transport/node-hid-singleton
- transport/node-speculos
- transport/react-native-hid
- transport/react-native-ble
- transport/connect-wallet

- title: Note on U2F
- title: FAQ & Troubleshooting
docs:
- transport/U2F

- transport/test-communication
75 changes: 75 additions & 0 deletions _docs/transport/application-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Application Architecture
subtitle:
tags: []
category: Connect a wallet
author:
toc: true
layout: doc
---


<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/application-architecture.png" ></div>
<!-- --------------------------------- -->

## Nano API calls

This section describes what are the role of the Nano API.
Indeed we call Nano API the "LedgerJS Dedicated App Lib" on the above image at the top of the page.
You must have encontered few of the APIs if you have gone through the <a href='../web-integration'>Integration Walkthrough</a>.
In the <a href='../web-integration'>Integration Walkthrough</a> we have mostly used the Bitcoin and Ethereum API provided by ledger.

The Nano API role is to help you to carry out operations in the "Nano Apps" (rf. image at the top).

The APIs are not written in the same way for all Nano apps. In addition, while some of them are provided by ledger, others are written by the various crypto communities.

You can have a look at how they are coded and documented at the <a href='https://github.com/LedgerHQ/ledgerjs'>LedgerHQ repository</a>.
You can also see the different Nano API provided by ledger below.

### Nano APIs provided by Ledger

Here is the list of all the APIs provided by Ledger.

| Blockchain | Nano API |
|-------------|--------------|
|Algorand | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-algorand.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-algorand) [@ledgerhq/hw-app-algorand](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-algorand) |
|Bitcoin | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-btc.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-btc) [@ledgerhq/hw-app-btc](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-btc) |
|Cosmos | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-cosmos.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-cosmos) [@ledgerhq/hw-app-cosmos](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-cosmos) |
|Elrond | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-elrond.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-elrond) [@ledgerhq/hw-app-elrond](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-elrond) |
|Ethereum | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-eth.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-eth) [@ledgerhq/hw-app-eth](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-eth) |
|Polkadot | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-polkadot.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-polkadot) [@ledgerhq/hw-app-polkadot](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-polkadot) |
|Solana | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-solana.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-solana) [@ledgerhq/hw-app-solana](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-solana) |
|Stellar | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-str.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-str) [@ledgerhq/hw-app-str](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-str) |
|Tezos | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-tezos.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-tezos) [@ledgerhq/hw-app-tezos](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-tezos) |
|Tron | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-trx.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-trx) [@ledgerhq/hw-app-trx](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-trx) |
|Ripple | [![npm](https://img.shields.io/npm/v/@ledgerhq/hw-app-xrp.svg)](https://www.npmjs.com/package/@ledgerhq/hw-app-xrp) [@ledgerhq/hw-app-xrp](https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-app-xrp) |


### Nano APIs provided by the crypto-asset community

You may find these libraries on the GitHub repositories written by the community.

We currently do not have an updated list of all community-developed Nano APIs. If you wish to contribute yours, please use the comment box at the bottom of this page.

Here is the list of all the APIs from the community that you can find on npm.

| Blockchain | Nano API |
|-------------|--------------|
|Vite | [![npm](https://img.shields.io/npm/v/@vite/ledgerjs-hw-app-vite.svg)](https://www.npmjs.com/package/@vite/ledgerjs-hw-app-vite) [ledgerjs-hw-app-vite](https://github.com/vitelabs/ledgerjs-hw-app-vite) |
|Ergo | [![npm](https://img.shields.io/npm/v/ledgerjs-hw-app-ergo.svg)](https://www.npmjs.com/package/ledgerjs-hw-app-ergo) [ledgerjs-hw-app-ergo](https://github.com/tesseract-one/ledger-app-ergo) |
|Cardano | [![npm](https://img.shields.io/npm/v/@cardano-foundation/ledgerjs-hw-app-cardano.svg)](https://www.npmjs.com/package/@cardano-foundation/ledgerjs-hw-app-cardano) [@cardano-foundation/ledgerjs-hw-app-cardano](https://github.com/cardano-foundation/ledger-app-cardano) |
|Sia | [![npm](https://img.shields.io/npm/v/@siacentral/ledgerjs-sia.svg)](https://www.npmjs.com/package/@siacentral/ledgerjs-sia) [@siacentral/ledgerjs-sia](https://github.com/siacentral/ledgerjs-sia) |

## Nano API-less calls

When there is no available Nano API, the way to make your Nano calls is by constructing the call yourself, by using the syntax information found in the application documentation.

Here are some examples:

| Blockchain App | Application documentation |
|-------------|--------------|
| Polymath | [Polymath](https://github.com/LedgerHQ/app-polymesh/blob/master/docs/APDUSPEC.md) |
| Filecoin | [Filecoin](https://github.com/LedgerHQ/app-filecoin/blob/master/docs/APDUSPEC.md) |

15 changes: 15 additions & 0 deletions _docs/transport/architecture-dataflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Architecture Dataflow
subtitle:
tags: []
category: Connect a wallet
author:
toc: true
layout: doc
---


<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/web-sequence.png" ></div>
<!-- --------------------------------- -->
16 changes: 10 additions & 6 deletions _docs/transport/choose-the-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ toc: true
layout: doc
---

## WebApp
On the client side device (Desktop & Mobile) several technologies can be used to communicate with Ledger hardware devices.

Based on your current service implementation you could choose different types of integration. First of all it will depend on your current service implementation technology.

### WebApp
For a web application three options are possible :
- Web HID
- Web USB
Expand All @@ -19,9 +23,9 @@ For a web application three options are possible :
<img width="840" src="../images/webAppsummary.png" ></div>
<!-- --------------------------------- -->

Getting started with WebApp integration => <a href="../web-integration">here</a>
Getting started with WebApp integration => <a href="../web-hid-usb">here</a>

## Mobile Application
### Mobile Application
For Mobile applications you can integrate through React Native libraries HID and Bluetooth for Nano X wallets.
- React Native HID (Only Android)
- React Native Bluetooth (Nano X)
Expand All @@ -31,9 +35,9 @@ For Mobile applications you can integrate through React Native libraries HID and
<img width="840" src="../images/mobile-integration.png" ></div>
<!-- --------------------------------- -->

Getting started with Mobile App integration => <a href="../mobile-integration">here</a>
Getting started with Mobile App integration => <a href="../react-native-android-hid">here</a>

## Desktop Application
### Desktop Application
For a desktop application your option is to use Node HID Transport layer. The library is only supported on Electron/Node.js
- Node HID

Expand All @@ -42,4 +46,4 @@ For a desktop application your option is to use Node HID Transport layer. The li
<img width="840" src="../images/desktop-integration.png" ></div>
<!-- --------------------------------- -->

Getting started with Desktop App integration => <a href="../desktop-integration">here</a>
Getting started with Desktop App integration => <a href="../node-electron-hid">here</a>
24 changes: 0 additions & 24 deletions _docs/transport/connectivity-capabilities.md

This file was deleted.

87 changes: 0 additions & 87 deletions _docs/transport/desktop-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,93 +18,6 @@ Packages from ledger will help you build a desktop application where you can con
Before diving into the code you have to understand that desktop application is only available for the HID type of connexion. Ledger provide you with an electon integration, and this integration is provided with the package:
- Node HID : <a href="https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-transport-node-hid">@ledgerhq/hw-transport-node-hid</a>


## Prerequisites

Beforehand we have to install some dependencies. First install <a href="https://nodejs.org/en/download/">Node & npm</a>, choose the LTS version of your operating system. To ensure you have it installed in your machine open a new terminal and run:
- ``` node -v ``` The commands should print the versions of Node.js and npm accordingly.
- ``` npm -v ``` The commands should print the versions of Node.js and npm accordingly.


Now that node and npm are installed, you have to install the <a href="https://www.ledger.com/ledger-live/download">Ledger Live</a> desktop application in order to connect your Ledger device.
After the installation of Ledger Live is finished open Ledger Live and go to the “Manager” tab.
In this integration we will use the bitcoin application from your Ledger.

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/ledgerlivetabs.png" ></div>
<!-- --------------------------------- -->

Then connect your Ledger to your machine make sure to unlock it.

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="420" src="../images/ledgerCodePin.jpg" ></div>
<!-- --------------------------------- -->

Then Ledger Live will ask you to allow the Ledger device, just press the two buttons simultaneously to allow it.

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="420" src="../images/ledgerConnect.png" >
<img width="420" src="../images/ledgerAllow.jpg" >
</div>
<!-- --------------------------------- -->

Now you can install the bitcoin application into your Ledger Nano S/X

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/bitcoinInstallation.png" ></div>
<!-- --------------------------------- -->

#### To use bitcoin app, you have to create a bitcoin account

To use the bitcoin application you previously installed, you have to create a bitcoin account.
Therefore launch the bitcoin application on your Ledger Nano S/X.
Then do the following steps to create your bitcoin account:

- Open the bitcoin app on your ledger device

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="420" src="../images/ledgerBtc.jpg" ></div>
<!-- --------------------------------- -->

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="420" src="../images/ledgerReady.jpg" ></div>
<!-- --------------------------------- -->

- You can create an account by going to the "Manager" tab and click on "Add account".

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/bitcoinInstalled.png" ></div>
<!-- --------------------------------- -->

- Click on "add account" button

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/step1account.png" ></div>
<!-- --------------------------------- -->

- Your account is created

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/step2account.png" ></div>
<!-- --------------------------------- -->

Now you have a bitcoin account, congratulations!

<!-- ------------- Image ------------- -->
<div style="text-align:center">
<img width="840" src="../images/step3account.png" ></div>
<!-- --------------------------------- -->


## Node HID application
Node HID application will allow you to create a desktop electron application which connects to your Ledger device via the HID protocol.

Expand Down
Binary file modified _docs/transport/images/Xcode-locations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/Xcode-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/android-studio-SDK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _docs/transport/images/android-studio-app.png
Binary file not shown.
Binary file removed _docs/transport/images/android-studio-devices.png
Binary file not shown.
Binary file removed _docs/transport/images/android-studio-home.png
Binary file not shown.
Binary file removed _docs/transport/images/android-studio-project.png
Binary file not shown.
Binary file modified _docs/transport/images/android-studio-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/android-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/bitcoinInstallation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/bitcoinInstalled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _docs/transport/images/connect-wallet.jpg
Binary file not shown.
Binary file modified _docs/transport/images/connectivity1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/connectivity2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/ethereumInstallation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/folderWebBle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/ledgerlivetabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _docs/transport/images/node-npm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _docs/transport/images/packageJsonInit.png
Binary file not shown.
Binary file removed _docs/transport/images/packageJsonInstall.png
Binary file not shown.
Binary file removed _docs/transport/images/packageJsonScript.png
Binary file not shown.
Binary file modified _docs/transport/images/step1account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/step2account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _docs/transport/images/step3account.png
Binary file added _docs/transport/images/web-sequence.png
Binary file modified _docs/transport/images/webBle1.png
Binary file modified _docs/transport/images/webBle2.png
Binary file modified _docs/transport/images/webBle3.png
Binary file modified _docs/transport/images/webBle4.png
Binary file modified _docs/transport/images/webapp1.png
Binary file modified _docs/transport/images/webapp2.png
Binary file modified _docs/transport/images/webapp3.png
Loading

0 comments on commit 62c6fad

Please sign in to comment.