GithubHelp home page GithubHelp logo

isabella232 / app-kadena Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ledgerhq/app-kadena

0.0 0.0 0.0 963 KB

License: Apache License 2.0

Shell 0.43% JavaScript 0.07% Rust 13.26% TypeScript 24.03% Nix 62.21%

app-kadena's Introduction

Kadena Ledger App

This application is compatible with

  • Ledger Nano S, running FW 2.1.0 and above
  • Ledger Nano S+, running FW 1.0.3
  • Ledger Nano X

Note: the compatibility with Ledger Nano X has only been checked on Speculos emulator

Installation using the pre-packaged tarball

Before installing please ensure that your device is plugged, unlocked, and on the device home screen.

Installing the app from a tarball can be done using ledgerctl. For more information on how to install and use that tool see the instructions from LedgerHQ.

tar xzf release.tar.gz
cd kadena
ledgerctl install -f app.json

Using nix, ledgerctl can only so be obtained by running this from the root of the repo.

$(nix-build --no-out-link -A alamgu.ledgerctl)/bin/ledgerctl install -f app.json

Using the app with generic CLI tool

The bundled generic-cli tool can be used to obtaining the public key and do signing.

To use this tool first install it using Nix. From the root level of this repo, run:

nix-build -A alamgu.generic-cli -o result-generic-cli

This command will create a file (symlink) named result-generic-cli which could be used as described below.

./result-generic-cli/bin/generic-cli getAddress "44'/626'/0'/0/0"

For signing, the "cmd" of the transaction (in the JSON format) should be provided like this

./result-generic-cli/bin/generic-cli sign --json "44'/626'/0'/0/0" '{"networkId":"mainnet01","payload":{"exec":{"data":{"ks":{"pred":"keys-all","keys":["368820f80c324bbc7c2b0610688a7da43e39f91d118732671cd9c7500ff43cca"]}},"code":"(coin.transfer-create \"alice\" \"bob\" (read-keyset \"ks\") 100.1)\n(coin.transfer \"bob\" \"alice\" 0.1)"}},"signers":[{"pubKey":"6be2f485a7af75fedb4b7f153a903f7e6000ca4aa501179c91a2450b777bd2a7","clist":[{"args":["alice","bob",100.1],"name":"coin.TRANSFER"},{"args":[],"name":"coin.GAS"}]},{"pubKey":"368820f80c324bbc7c2b0610688a7da43e39f91d118732671cd9c7500ff43cca","clist":[{"args":["bob","alice",0.1],"name":"coin.TRANSFER"}]}],"meta":{"creationTime":1580316382,"ttl":7200,"gasLimit":1200,"chainId":"0","gasPrice":1.0e-5,"sender":"alice"},"nonce":"2020-01-29 16:46:22.916695 UTC"}'

Alternatively the contents of JSON could be copied to a file, and the name of the file could be used in the command-line instead. This is necessary when the size of the JSON being signed is very big, as the command-line has limits to the length.

The following command demonstrates signing a big transaction specified in the file ./ts-tests/marmalade-tx.json

./result-generic-cli/bin/generic-cli sign --file --json "44'/626'/0'/0/0" ./ts-tests/marmalade-tx.json

Building the app from source

Note: the latest release branch for NanoS+ is main and for NanoS is nano-s, but the default branch in the git repo is develop. If you want to use the latest release, make sure you have the correct branch checked out before doing the build.

This application has been packaged up with Nix.

Nix/Linux

Using Nix, from the root level of this repo, run:

For NanoS+

nix-shell -A alamgu.rustShell
cd rust-app/
# It is possible to build Nano X app by replacing 'nanosplus' with 'nanox'
# but currently it not possible to load the app on Nano X devices.
cargo-ledger ledger -l nanosplus

For NanoS (on 'nano-s' branch)

nix-shell -A alamgu.rustShell
cd rust-app/
cargo-ledger load

The cargo-ledger builds, outputs a hex file and a manifest file for ledgerctl, and loads it on a device in a single cargo-ledger ledger -l nanosplus command in the rust-app folder within app directory.

You do not need to install cargo-ledger outside of the nix-shell.

Before installing, please ensure that your device is plugged, unlocked, and on the device home screen.

Running tests

Using Nix, from the root level of this repo, run:

For NanoS+ / NanoX

nix-shell -A alamgu.rustShell
cd rust-app/
cargo test --target=nanosplus.json
cargo test --target=nanox.json

For NanoS (on 'nano-s' branch)

nix-shell -A alamgu.rustShell
cd rust-app/
cargo test

app-kadena's People

Contributors

ericson2314 avatar dfordivam avatar jonored avatar yhql avatar pscott avatar apollounicorn avatar madeline-os avatar

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.