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

device: Trezor support added, requires #5211 #2019

Merged
merged 1 commit into from Apr 3, 2019

Conversation

Projects
None yet
7 participants
@ph4r05
Copy link
Contributor

commented Mar 15, 2019

Trezor support enabled.
All the work was done in Wallet::API and monero-project/monero#5211

Screenshot 2019-03-15 at 14 29 17

Building

In order to test this PR you need to fetch my original branch as it requires newer Monero submodule

git clone --recursive https://github.com/monero-project/monero-gui.git
cd monero-gui
git remote add ph4r05 https://github.com/ph4r05/monero-gui.git
git fetch --all
git checkout -b trezor-dev ph4r05/trezor-dev

cd monero
git remote add ph4r05 https://github.com/ph4r05/monero.git
git fetch --all
git checkout -b trezor/api_pass ph4r05/trezor/api_pass
git submodule update --recursive
cd -
./build.sh

Troubleshooting

If you experience Bad offset calculation error when creating a transaction the remote node you are using is probably running too old version.

The code is known to work with version 131076. For testing purposes, try node 173.255.205.142:18089, it should work smoothly.

@xmrdsc

xmrdsc approved these changes Mar 16, 2019

@MaxXor

MaxXor approved these changes Mar 18, 2019

@ph4r05 ph4r05 referenced this pull request Mar 25, 2019

Open

[WIP] Trezor integration roadmap #4810

26 of 31 tasks complete
@mariodian

This comment has been minimized.

Copy link

commented Mar 26, 2019

It says "hardware device not supported" when the password is typed. I'm trying to open an existing wallet that was created with wallet-trezor-cli some time ago.

When I try to create a new wallet with Trezor it throws error: device not found: Trezor right on the first screen where you choose between Ledger and Trezor.

I'm building on MacOS 10.14.3 and Xcode 10.2.

Also the build process ends up with these warnings:

ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(wallet_manager.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(wallet.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(utils.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(version.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(mlog.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(cryptonote_format_utils.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(cryptonote_basic_impl.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libeasylogging.a(easylogging++.cc.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(device.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(wipeable_string.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(hex.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(mlocker.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(http_auth.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(util.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(updates.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(wallet2.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(dns_utils.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(subaddress.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(address_book.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(subaddress_account.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(pending_transaction.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(transaction_history.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(unsigned_transaction.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(crypto.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(electrum-words.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(account.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(memwipe.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(i18n.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(checkpoints.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(multisig.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(cryptonote_tx_utils.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(device_default.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(device_ledger.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(rctOps.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(rctSigs.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(rctTypes.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libepee.a(string_tools.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(threadpool.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(node_rpc_proxy.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(password.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(notify.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(base58.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(ringdb.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(transaction_info.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(chacha.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(hash.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(slow-hash.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(crypto-ops.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(random.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(keccak.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(tree-hash.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(miner.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(log.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(device_io_hid.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(bulletproofs.cc.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(perf_timer.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(spawn.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(aesb.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(crypto-ops-data.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(hash-extra-blake.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(hash-extra-groestl.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(hash-extra-jh.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(hash-extra-skein.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/liblmdb.a(mdb.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(oaes_lib.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(rctCryptoOps.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(CryptonightR_JIT.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(CryptonightR_template.S.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(difficulty.cpp.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(multiexp.cc.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(blake256.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(groestl.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(jh.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/liblmdb.a(midl.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(skein.c.o)) was built for newer OSX version (10.14) than being linked (10.12)
ld: warning: object file (/Users/mariodian/Source/Monero/monero-gui/monero/lib/libwallet_merged.a(aligned.c.o)) was built for newer OSX version (10.14) than being linked (10.12)

Are there some specific steps to build it?

@ph4r05

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Are you using passphrase entry on host? This one is not supported.

Can you recover the wallet from scratch from the device? (Create new wallet file using the device - it will have the same address)

@ph4r05

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

I also had to modify a get_lib_wallet.sh a bit in order to build from monero master. Otherwise it checks out v0.13 branch (without trezor support - your case).

Check out my trezor-dev branch which builds the monero master for the GUI.

https://github.com/ph4r05/monero-gui/tree/trezor-dev

If the build is still failing do in the monero-gui folder:

cd monero
git remote add ph4r05 https://github.com/ph4r05/monero.git
git fetch --all
git checkout -b trezor/api_pass ph4r05/trezor/api_pass
git submodule update --recursive
cd -
./build.sh
@mariodian

This comment has been minimized.

Copy link

commented Apr 1, 2019

Are you using passphrase entry on host? This one is not supported.

It crashes before I can get to the passphrase screen.

Can you recover the wallet from scratch from the device? (Create new wallet file using the device - it will have the same address)

No.

If the build is still failing do in the monero-gui folder:

Building release
~/Source/Monero/monero-gui ~/Source/Monero/monero-gui
~/Source/Monero/monero-gui ~/Source/Monero/monero-gui
~/Source/Monero/monero-gui/monero ~/Source/Monero/monero-gui ~/Source/Monero/monero-gui
You are currently on commit 56be14b76
The most recent tag was at f96e431a1
You are ahead of or behind a tagged release
~/Source/Monero/monero-gui ~/Source/Monero/monero-gui
--- Current head: 56be14b76
libwallet_merged.a not found - Building libwallet
Building libwallet release
cleaning up existing monero build dir, libs and includes
~/Source/Monero/monero-gui/monero/build/release ~/Source/Monero/monero-gui ~/Source/Monero/monero-gui
Configuring build for MacOS..
CMake Error: The source directory "/Users/mariodian/Source/Monero/monero-gui/monero" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
./get_libwallet_api.sh: line 225: pushd: /Users/mariodian/Source/Monero/monero-gui/monero/build/release/src/wallet: No such file or directory
cat version.sh >version
chmod a+x version
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.
~/Source/Monero/monero-gui ~/Source/Monero/monero-gui
./get_libwallet_api.sh: line 234: pushd: /Users/mariodian/Source/Monero/monero-gui/monero/build/release/src/daemon: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.
~/Source/Monero/monero-gui
make: *** /Users/mariodian/Source/Monero/monero-gui/monero/build/release/contrib/epee: No such file or directory.  Stop.
make: *** /Users/mariodian/Source/Monero/monero-gui/monero/build/release/external/easylogging++: No such file or directory.  Stop.
make: *** /Users/mariodian/Source/Monero/monero-gui/monero/build/release/external/db_drivers/liblmdb: No such file or directory.  Stop.
./get_libwallet_api.sh: line 259: popd: directory stack empty
...
...
In file included from ../main.cpp:44:
../src/libwalletqt/WalletManager.h:7:10: fatal error: 'wallet/api/wallet2_api.h' file not found
#include <wallet/api/wallet2_api.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [main.o] Error 1
@mariodian

This comment has been minimized.

Copy link

commented Apr 1, 2019

Your instructions didn't work, however the code does. Thanks!

What I had to do:

git clone https://github.com/ph4r05/monero-gui.git
cd monero-gui
git clone --recursive https://github.com/ph4r05/monero.git
git checkout trezor-dev
./build.sh
@ph4r05

This comment has been minimized.

Copy link
Contributor Author

commented Apr 1, 2019

Did you do recursive clone of the monero-gui in the first place? Maybe that was the problem.

@ph4r05

This comment has been minimized.

Copy link
Contributor Author

commented Apr 1, 2019

@dEBRUYNE-1 I was wondering (to be sure), do you think this PR will make it to the next GUI release? Thanks!

@dEBRUYNE-1

This comment has been minimized.

Copy link
Contributor

commented Apr 1, 2019

@ph4r05 - Yes, absolutely! It's already on the merge list. We're currently just waiting for luigi1111 to have some spare time so he can merge it.

@mariodian

This comment has been minimized.

Copy link

commented Apr 3, 2019

Did you do recursive clone of the monero-gui in the first place? Maybe that was the problem.

Yup, that may have been the problem.

@selsta

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

Screenshot 2019-04-03 at 19 50 21

I wonder how we could fix this, increasing the z value doesn’t seem to help.
@selsta
Copy link
Contributor

left a comment

diff --git a/wizard/WizardCreateDevice1.qml b/wizard/WizardCreateDevice1.qml
index 9ad2ca3..2f91fca 100644
--- a/wizard/WizardCreateDevice1.qml
+++ b/wizard/WizardCreateDevice1.qml
@@ -148,6 +148,7 @@ Rectangle {
 
                 Layout.topMargin: 10 * scaleRatio
                 Layout.fillWidth: true
+                z: 3
 
                 ColumnLayout{
                     MoneroComponents.StandardDropdown {

Edit: #2052

Small improvement, working great otherwise :)

@luigi1111 luigi1111 merged commit 9074633 into monero-project:master Apr 3, 2019

5 of 6 checks passed

buildbot/monero-gui-osx-10.13 Build done.
Details
buildbot/monero-gui-osx-10.11 Build done.
Details
buildbot/monero-gui-ubuntu-amd64 Build done.
Details
buildbot/monero-gui-ubuntu-i686 Build done.
Details
buildbot/monero-gui-win32 Build done.
Details
buildbot/monero-gui-win64 Build done.
Details

luigi1111 added a commit that referenced this pull request Apr 3, 2019

Merge pull request #2019
9074633 device: Trezor support added (ph4r05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.