Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: rename sui to iota #8

Merged
merged 10 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ runner = "./speculos-wrapper -m nanox "
[alias]
tt = "test --features extra_debug"
br = "build --release"
stackcheck = "stack-sizes --release --bin sui --target=thumbv6m-none-eabi"
stackcheck = "stack-sizes --release --bin iota --target=thumbv6m-none-eabi"
16 changes: 8 additions & 8 deletions .github/workflows/functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
workflow_call:
inputs:
app_repository:
description: 'The GIT repository to test (defaults to `github.repository`)'
description: "The GIT repository to test (defaults to `github.repository`)"
required: false
default: ${{ github.repository }}
type: string
app_branch_name:
description: 'The GIT branch to test (defaults to `github.ref`)'
description: "The GIT branch to test (defaults to `github.ref`)"
required: false
default: ${{ github.ref }}
type: string
download_app_binaries_artifact:
description: 'The name of the artifact containing the application binary file(s) to be tested. Required'
description: "The name of the artifact containing the application binary file(s) to be tested. Required"
required: true
type: string
run_for_devices:
Expand All @@ -26,15 +26,15 @@ on:
'ledger_app.toml' manifest.
If the manifest is missing, defaults to ALL (["nanos", "nanox", "nanosp", "stax"]).
required: false
default: 'None'
default: "None"
type: string
upload_snapshots_on_failure:
description: 'Enable or disable upload of tests snapshots if the job fails (defaults to true).'
description: "Enable or disable upload of tests snapshots if the job fails (defaults to true)."
required: false
default: true
type: boolean
test_filter:
description: 'Specify an expression which implements a substring match on the test names'
description: "Specify an expression which implements a substring match on the test names"
required: false
default: '""'
type: string
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
uses: borales/actions-yarn@v4
with:
cmd: help # No-op, do yarn install later
dir: 'ts-tests'
dir: "ts-tests"

- name: Install tests dependencies
run: |
Expand All @@ -94,7 +94,7 @@ jobs:
- name: Run test
run: |
BIN_DIR_NAME="$(echo ${{ matrix.device }} | sed 's/nanosp/nanosplus/')"
speculos --api-port 5005 ${{ needs.call_get_app_metadata.outputs.build_directory }}/build/${BIN_DIR_NAME}/release/sui --display headless &
speculos --api-port 5005 ${{ needs.call_get_app_metadata.outputs.build_directory }}/build/${BIN_DIR_NAME}/release/iota --display headless &
sleep 5
cd ts-tests
echo "Doing yarn install"
Expand Down
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sui Blockchain app for Ledger
# Iota Blockchain app for Ledger

[Ledger](https://www.ledger.com/) application for the [Sui Blockchain](https://sui.io/).
[Ledger](https://www.ledger.com/) application for the [Iota Blockchain](https://www.iota.org/).

thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved
Written using [Alamgu](https://github.com/alamgu/).

Expand All @@ -9,6 +9,7 @@ Written using [Alamgu](https://github.com/alamgu/).
## Device Compatability

This application is compatible with

- Ledger Nano S, running firmware 2.1.0 and above
- Ledger Nano S+, running firmware 1.1.0
- Ledger Nano X
Expand All @@ -28,7 +29,7 @@ No steps need to be taken in advance.

On NixOS, one can easily do this with by adding the following to configuration.nix:

``` nix
```nix
{
# ...
hardware.ledger.enable = true;
Expand Down Expand Up @@ -70,21 +71,24 @@ First, follow our [general instructions](./NIX.md) for getting started with [Nix
Second, please ensure that your device is plugged, unlocked, and on the device home screen.

Finally, run the following command to load the app on your device:

```bash
nix --extra-experimental-features nix-command run -f . $DEVICE.loadApp
```

where `DEVICE` is one of
- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+

- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+

The app will be downloaded (if you have our Nix cache enabled) and/or freshly built as needed.

### Obtaining a release tarball

#### Download an official build

Check the [releases page](https://github.com/obsidiansystems/ledger-app-sui/releases) of this app to see if an official build has been uploaded for this release.
Check the [releases page](TODO) of this app to see if an official build has been uploaded for this release.
There is a separate tarball for each device.

#### Build one yourself, with Nix
Expand All @@ -93,13 +97,16 @@ First, follow our [general instructions](./NIX.md) for getting started with [Nix

There is a separate tarball for each device.
To build one, run:

```bash
nix-build -A $DEVICE.tarball
```

where `DEVICE` is one of
- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+

- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+

The last line printed out will be the path of the tarball.

Expand All @@ -113,7 +120,7 @@ By using Nix, this can be done simply by using the `load-app` command, without m

```bash
tar xzf /path/to/release.tar.gz
cd sui-$DEVICE
cd iota-$DEVICE
nix-shell
load-app
```
Expand All @@ -128,7 +135,7 @@ For more information on how to install and use that tool see the [instructions f

```bash
tar xzf release.tar.gz
cd sui-$DEVICE
cd iota-$DEVICE
ledgerctl install -f app.json
```

Expand All @@ -137,23 +144,28 @@ ledgerctl install -f app.json
The bundled [`generic-cli`](https://github.com/alamgu/alamgu-generic-cli) tool can be used to obtaining the public key and do signing.

To use this tool using Nix, from the root level of this repo, run this command to enter a shell with all the tools you'll need:

```bash
nix-shell -A $DEVICE.appShell
```

where `DEVICE` is one of
- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+

- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+

Then, one can use `generic-cli` like this:

- Get a public key for a BIP-32 derivation without prompting the user:

```shell-session
$ generic-cli getAddress --use-block "44'/4218'/0'/0'/0'"
a42e71c004770d1a48956090248a8d7d86ee02726b5aab2a5cd15ca9f57cbd71
```

- Show the address on device for a BIP-32 derivation and obtain the public key:

```shell-session
$ generic-cli getAddress --use-block --verify "44'/4218'/0'/0'/0'"
a42e71c004770d1a48956090248a8d7d86ee02726b5aab2a5cd15ca9f57cbd71
Expand Down
10 changes: 5 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rec {

inherit (alamgu) lib pkgs crate2nix alamguLib;

appName = "sui";
appName = "iota";

app-nix = alamgu.crate2nix-tools.generatedCargoNix {
name = "${appName}-nix";
Expand Down Expand Up @@ -149,8 +149,8 @@ rec {
cp app.hex $dest
cp ${./tarball-default.nix} $dest/default.nix
cp ${./tarball-shell.nix} $dest/shell.nix
cp ${./rust-app/sui.gif} $dest/sui.gif
cp ${./rust-app/sui-small.gif} $dest/sui-small.gif
cp ${./rust-app/iota.gif} $dest/iota.gif
cp ${./rust-app/iota-small.gif} $dest/iota-small.gif
'');

inherit
Expand Down Expand Up @@ -317,7 +317,7 @@ rec {
inherit localSystem;
};

sui-node-shell = nixpkgs-unstable.mkShell {
iota-node-shell = nixpkgs-unstable.mkShell {
strictDeps = true;
nativeBuildInputs = with nixpkgs-unstable.buildPackages; [
rustc
Expand All @@ -330,7 +330,7 @@ rec {
];
};

sui-wallet-shell = nixpkgs-unstable.mkShell {
iota-wallet-shell = nixpkgs-unstable.mkShell {
strictDeps = true;
nativeBuildInputs = with nixpkgs-unstable.buildPackages; lib.optional stdenv.isLinux [
# TODO make avaiable everywhere or skip whole thing on macOS
Expand Down
27 changes: 12 additions & 15 deletions guide.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
# How to use Sui app on your Ledger device
# How to use Iota app on your Ledger device

Thoralf-M marked this conversation as resolved.
Show resolved Hide resolved
Install the Sui app on your Ledger device to manage SUI Tokens with the [Sui Wallet](https://docs.sui.io/explore/wallet-browser).
Install the Iota app on your Ledger device to manage IOTA Tokens with the [Iota Wallet](TODO).

### 1. Before you start

- You've [initialized](https://support.ledgerwallet.com/hc/en-us/articles/360000613793) your Ledger device.
- The latest firmware is [installed](https://support.ledgerwallet.com/hc/en-us/articles/360002731113).
- Ledger Live is [ready to use](https://support.ledgerwallet.com/hc/en-us/articles/360006395233).

### 2. Install the Sui app
### 2. Install the Iota app

1. Open the Manager in Ledger Live.
2. Connect and unlock your Ledger device.
3. If asked, allow the manager on your device by pressing both buttons.
4. Find **Sui** in the app catalog.
4. Find **Iota** in the app catalog.
5. Press the **Install** button of the app.
- An installation window appears.
- Your device will display **Processing…**
- The app installation is confirmed.


### **3. Obtain Ledger Account Number**

- Open the Sui app on your Ledger device, the screen will display "Sui 0.1.0".
- Open the Iota app on your Ledger device, the screen will display "Iota 0.1.0".

- Open the Sui wallet and select "Connect to Ledger device".
- Open the Iota wallet and select "Connect to Ledger device".

- Enter the derivation path (default `m/44'/4218'/0'/0/0`).

- You can use this account to receive Sui tokens.
- You can use this account to receive Iota tokens.

### **4. Send Tokens from Ledger Account**

- Open the Sui wallet and click "Send" from the "Coins" tab.
- Open the Iota wallet and click "Send" from the "Coins" tab.

- Enter the amount and receiver's address, then click "Send Coins Now".

- Verify the details on your device display.

- Transfer Sui
- Transfer Iota

- Sender's address

- Receiver's address

- Amount

- Gas fees

- Press both buttons when asked to 'Confirm' to sign the transaction.
Expand All @@ -54,7 +53,5 @@ Install the Sui app on your Ledger device to manage SUI Tokens with the [Sui Wal

### **5. Contact info**

- Name: Ryan Servatius
- Email: [email protected]
- Legal Entity: Mysten Labs
- URL: https://sui.io/
- Email: [email protected]
- URL: https://www.iota.org/
38 changes: 19 additions & 19 deletions rust-app/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading