Step by Step Development Guide for Tron App on Ledger Hardware Wallet
This is a step-by-step tutorial to test Tron App code on Ledger Hardware Wallet. It is based on Ledger Nano S - but should also work for other hardware wallets such as Nano X
Prerequisites
You need to have hardware wallets (at least one).
Fork and clone https://github.com/LedgerHQ/app-tron
Development OS
We can develop using Windows, MAC or Linux. But Linux (Ubuntu) is preferred. Virtual Machine is a good idea such as VirtualBox
Download Ubuntu: https://ubuntu.com/download/desktop
Fork and Compile
- git clone https://github.com/LedgerHQ/app-tron
- Download
clang
(for ARM) and unzip it
wget -c "https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
- unzip it via
tar -xvf "clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
- Download prebuilt gcc
- Unzip it
tar -xvjf "the tar.bz2 file you downloaded in step 4"
- rename both folders
mv clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 clang-arm-fropi
mv gcc-arm-none-eabi-10-2020-q4-major gcc-arm-none-eabi-5_3-2016q1
Setting up the SDK
Now that you have your toolchain set up, you need to download / clone the SDK for the appropriate Ledger device you’re working with. Make sure you checkout the tag matching your firmware version.
- Ledger Nano S SDK: https://github.com/LedgerHQ/nanos-secure-sdk
- Ledger Nano X SDK: https://github.com/LedgerHQ/nanox-secure-sdk
- Ledger Blue SDK: https://github.com/LedgerHQ/blue-secure-sdk
Finally, link the environment variable BOLOS_SDK to the SDK you downloaded.
export BOLOS_SDK='/path/to/sdk'
//for example, /home/justyy/tron/nanos-secure-sdk
Also,
export BOLOS_ENV='/path/to/your/workspace'
//this is one directory up where you cloned app-tron
Install Dependency
sudo apt install libncurses5
sudo pip3 install ledgerblue
sudo pip install ledgerblue
Change python to python3 in Makefile
Make some code changes
For example, let's modify the text at src/main.c
Run make load
to compile your latest changes:
"No dongle found" means that you need to plugin the Ledger Wallet.
Testing
Allow Unsafe Manager
Confirm Action
Loading
Install App Tron
Perform Action
And it works!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thank you for reading ^^^^^^^^^^^^^^^
NEW! Following my Trail (Upvote or/and Downvote)
Follow me for topics of Algorithms, Blockchain and Cloud.
I am @justyy - a Steem Witness
https://steemyy.com
My contributions
- Video Downloader
- Steem Blockchain Tools
- Free Cryptos API
- VPS Database
- Computing Technology Blog
- A few useless tools
- And some other online software/tools
- Merge Files/Videos
- LOGO Turtle Programming Chrome Extension
- Teaching Kids Programming - Youtube Channel and All Contents
Delegation Service
Support me
If you like my work, please:
- Buy Me a Coffee, Thanks!
- Become my Sponsor, Thanks!
- Voting for me:
https://steemit.com/~witnesses type in justyy and click VOTE
- Delegate SP: https://steemyy.com/sp-delegate-form/?delegatee=justyy
- Vote @justyy as Witness: https://steemyy.com/witness-voting/?witness=justyy&action=approve
- Set @justyy as Proxy: https://steemyy.com/witness-voting/?witness=justyy&action=proxy
Alternatively, you can vote witness or set proxy here: https://steemit.com/~witnesses
👍👍
看不懂,感觉很牛逼
请验证🙏🏻帮助我
😄😁😀
[WhereIn Android] (http://www.wherein.io)
Why run as root in
/home/justyy
? Do you need to be root to compile or exec?maybe not.
Ok. Didn't know if access to the wallet required root or something.