Giter Club home page Giter Club logo

app-near-rs's Introduction

Ledger NEAR Application

Rule enforcer Build and tests

This is a Near application written in Rust for the Ledger Nano S/X/SP devices.

  • Implements standard features (display address, transaction signature...),
  • Has functional tests using Ragger,
  • Has CI workflows mandatory for app deployment in the Ledger store.

Development log

Details of the structure of application, features and encountered problems as seen during initial development cycle are present in issue.

Advantages in comparison with app-near

Links

Quick start guide

With VS Code

You can quickly setup a development environment on any platform (macOS, Linux or Windows) to build and test your application with Ledger's VS Code extension.

By using Ledger's own developer tools Docker image, the extension allows you to build your apps with the latest SDK, test them on Speculos and load them on any supported device.

  • Install and run Docker.
  • Make sure you have an X11 server running :
    • On Ubuntu Linux, it should be running by default.
    • On macOS, install and launch XQuartz (make sure to go to XQuartz > Preferences > Security and check "Allow client connections").
    • On Windows, install and launch VcXsrv (make sure to configure it to disable access control).
  • Install VScode and add Ledger's extension.
  • Open a terminal and clone app-near-rust with git clone [email protected]:dj8yfo/app-near-rs.git.
  • Open the app-near-rust folder with VSCode.
  • Use Ledger extension's sidebar menu or open the tasks menu with ctrl + shift + b (command + shift + b on a Mac) to conveniently execute actions :
    • Build the app for the device model of your choice with Build.
    • Test your binary on the Speculos emulator with Run with emulator.
    • You can also run functional tests, load the app on a physical device, and more.

โ„น๏ธ The terminal tab of VSCode will show you what commands the extension runs behind the scene.

Compilation and load

Building

You can build the Near app with the following command executed in the root directory of the app.

cargo ledger build nanox 

This command will build the app for the Nano X, but you can use any supported device (nanos, nanox, nanosplus)

Loading

โ„น๏ธ Your device must be connected, unlocked and the screen showing the dashboard (not inside an application).

cargo-ledger also allows you to side load the binary with the following command line executed in the root directory of the Near app.

cargo ledger build nanox --load

As for the build command, you can replace nanos with nanox or nanosplus.

Emulator

You can also run the app directly on the Speculos emulator

speculos --model nanox target/nanox/release/app-near-rust

Testing

See local_test_helper.sh and Justfile

Unit testing

See local_unit_tests.sh.

Continuous Integration

The following workflows are executed in GitHub Actions :

  • Ledger guidelines enforcer which verifies that an app is compliant with Ledger guidelines. The successful completion of this reusable workflow is a mandatory step for an app to be available on the Ledger application store. More information on the guidelines can be found in the repository ledger-app-workflow
  • Compilation of the application for all supported devices in the ledger-app-builder docker image
  • End-to-end tests with the Speculos emulator and ragger (see tests/)
  • Various lint checks :
    • Source code lint checks with cargo fmt
    • Python functional test code lint checks with pylint and mypy

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.