Test cases are based on the following seed:
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
Select 12 words, enter 11 times abandon
and one time about
.
This is the seed phrase we are going to use everywhere. Obviously don't use it to store your funds (unless testnet).
First Private key from this seed is b5a4cea271ff424d7c31dc12a3e43e401df7a40d7412a15750f3f0b6b5449a28
Public key: 04ff21f8e64d3a3c0198edfbb7afdc79be959432e92e2f8a1984bb436a414b8edcec0345aad0c1bf7da04fd036dd7f9f617e30669224283d950fab9dd84831dc83
Address: 41c8599111f29c1e1e061265b4af93ea1f274ad78a
Address base 58: TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH
Testers, jump to: Load pre-compiled HEX file.
git clone https://github.com/fbsobreira/trx-ledger.git
cd trx-ledger
In order to make compiling as eas as possible you can make use of a docker image containing all the necessary compilers and the nanos-secure-sdk.
Make sure you have Docker installed.
make sure to select the appropriate $BOLOS_SDK in Dockerfile
docker build -t ledger-chain:latest .
The .
at the end is important!
docker run --rm -v "$(pwd)":/trx-ledger -w /trx-ledger ledger-chain make
make
Before attempting to load the hex file, make sure your Ledger Nano S is connected and the firware is updated to the latest version.
Enter your PIN and make sure you're seeing the Dashboard app.
[sudo] pip install -U setuptools
[sudo] pip install virtualenv
libudev1 libudev-dev libusb-1.0-0-dev
virtualenv -p python3 ledger
source ledger/bin/activate
pip install ledgerblue
or pip install git+https://github.com/LedgerHQ/blue-loader-python.git
If you run into errors here, make sure you have the required dependencies installed. See Ledger - Loader Python.
python -m ledgerblue.loadApp \
--targetId 0x31100003 \
--fileName bin/app.hex \
--icon `docker run --rm -v "$(pwd)":/trx_ledger -w /trx_ledger ledger-chain sh -c 'python $BOLOS_SDK/icon.py icon.gif hexbitmaponly'` \
--curve secp256k1 \
--path "44'/195'" \
--apdu \
--appName "Tron" \
--appVersion `cat ./VERSION` \
--appFlags 0x40 \
--delete \
--dataSize `cat debug/app.map | grep _nvram_data_size | tr -s ' ' | cut -f2 -d' '` \
--tlv
To get out of your Python virtualenv again after everything is done.
deactivate
make load
Testers should start here.
Download a copy of the latest HEX file here.
Write down or remember the version number without the v
. v0.0.1
becomes 0.0.1
.
Write down the dataSize
. You will need these in the step 3.
See step 1 above.
See step 2 above.
python -m ledgerblue.loadApp \
--targetId 0x31100003 \
--fileName NAME_OF_PRECOMPILED_HEX_HERE.hex \
--icon 0100000000ffffff0000000000fc000c0f3814c822103f101120092005400340018001800000000000 \
--curve secp256k1 \
--path "44'/195'" \
--apdu \
--appName "Tron" \
--appVersion "VERSION_NUMBER" \
--appFlags 0x40 \
--delete \
--dataSize DATA_SIZE_OF_PRECOMPILED_HEX \
--tlv
Replace NAME_OF_PRECOMPILED_HEX_HERE.hex
with the location and name of the pre-compiled HEX file.
Replace VERSION_NUMBER
with the version number of the pre-compiled HEX file.
Replace DATA_SIZE_OF_PRECOMPILED_HEX
with the data size of the pre-compiled HEX file.
See step 4 above.
========