justinmoon / junction

UI For Using Hardware Wallets With Bitcoin Core
MIT License
60 stars 13 forks source link

Building From Source on Windows 10 #23

Closed nopara73 closed 5 years ago

nopara73 commented 5 years ago

I am trying to build junction on Windows 10. This is a guide on how to do that and what blocker I find (if any.)

Original Guide

For reference, I copied the original Linux guide here:

Prerequisites.

See this tweetstorm for screenshots. They'll probably go out-of-date quickly ...

Junction project uses HWI to communicate with hardware wallets. Follow these instructions to install libusb dependency for HWI (don't do the poetry install step). If you're on Linux you may need to install udev rules.

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
mkdir wallets
python ui.py

Open localhost:5000 in your browser

Quick Tangent: WSL

I tried and succeeded to build junction on Windows - Subsystem For Linux, but unfortunately libusb devices are not discoverable from there, so that's a blocker.

The Windows 10 Build Guide

Prerequisites.

  1. Get and run Bitcoin Core with RPC user and password set in config in server mode the bitcoinqt or normally bitcoind.
  2. Install Python 3.7

Build and Run.

python3 -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
mkdir wallets
python ui.py

Error.

The above steps are working perfectly, the only modification needed was replacing source venv/bin/activate with venv\Scripts\activate as this stackoverflow reply suggest. However for python ui.py I get this error.

(venv) C:\Users\user\Desktop\junction>python ui.py
Traceback (most recent call last):
  File "ui.py", line 7, in <module>
    from hwilib.devices import trezor
  File "C:\Users\user\Desktop\junction\venv\lib\site-packages\hwilib\devices\trezor.py", line 15, in <module>
    from usb1 import USBErrorNoDevice
  File "C:\Users\user\Desktop\junction\venv\lib\site-packages\usb1\__init__.py", line 61, in <module>
    from . import libusb1
  File "C:\Users\user\Desktop\junction\venv\lib\site-packages\usb1\libusb1.py", line 199, in <module>
    libusb = _loadLibrary()
  File "C:\Users\user\Desktop\junction\venv\lib\site-packages\usb1\libusb1.py", line 173, in _loadLibrary
    return dll_loader('libusb-1.0' + suffix, **loader_kw)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
nopara73 commented 5 years ago

I figured it out.

  1. I had to download the "latest windows binaries" for libusb: https://libusb.info/.
  2. Copy MS64\dll\libusb-1.0.dll to C:\Windows\System32.

And it will work. I will hit it for a bit, then create a PR with the guide if everything works well.

nopara73 commented 5 years ago

Something is still wrong. On the mainnet, I create wallet, set rpc then click "add signer".

image

Then get this error:

http://127.0.0.1:5000/add-signer/c2f5b203
Error: -5: Invalid descriptor

image

nopara73 commented 5 years ago

I tried it on the testnet and now the add signer worked properly, I received money, waited until it confirms and tried to send. (I set my coldcard to testnet, too.)

On my coldcard I ACKed the signing operation, then: Failure, signing failed late (psbt.py:1315).

nopara73 commented 5 years ago

Ok, I'm cosing this, because the original issue regarding build is resolved.

Summary