1
0
SomberNight 85940e7e3d hw plugins: cmdline: fix offline commands for encrypted hw wallets
```
$ ./run_electrum --testnet signmessage -w /home/user/.electrum/testnet/wallets/test_trezor_white_bip84 tb1q5pguna9y2g9y2gsu8r8gmxeye2cefvyly8dg02 heyheyhey -o
  0.84 | W | plugins.jade.jadepy.jade | No module named 'electrum.plugins.jade.jadepy.jade_ble'
  0.84 | W | plugins.jade.jadepy.jade | BLE scanning/connectivity will not be available
  3.73 | E | __main__ | error running command (without daemon)
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/plugins/trezor/clientbase.py", line 151, in get_xpub
    node = trezorlib.btc.get_public_node(self.client, address_n).node
  File "/home/user/.local/lib/python3.10/site-packages/trezorlib/tools.py", line 274, in wrapped_f
    ret = f(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/trezorlib/btc.py", line 125, in get_public_node
    return client.call(
  File "/home/user/.local/lib/python3.10/site-packages/trezorlib/tools.py", line 297, in wrapped_f
    return f(client, *args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/trezorlib/client.py", line 260, in call
    resp = self._callback_pin(resp)
  File "/home/user/.local/lib/python3.10/site-packages/trezorlib/client.py", line 186, in _callback_pin
    pin = self.ui.get_pin(msg.type)
  File "/home/user/wspace/electrum/electrum/plugins/trezor/clientbase.py", line 308, in get_pin
    pin = self.handler.get_pin(msg.format(self.device), show_strength=show_strength)
AttributeError: 'NoneType' object has no attribute 'get_pin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/./run_electrum", line 540, in handle_cmd
    result = fut.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/user/wspace/electrum/./run_electrum", line 227, in run_offline_command
    password = get_password_for_hw_device_encrypted_storage(plugins)
  File "/home/user/wspace/electrum/./run_electrum", line 212, in get_password_for_hw_device_encrypted_storage
    return client.get_password_for_storage_encryption()
  File "/home/user/wspace/electrum/electrum/plugin.py", line 523, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "/home/user/wspace/electrum/electrum/plugin.py", line 516, in run_in_hwd_thread
    return fut.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/user/wspace/electrum/electrum/plugins/hw_wallet/plugin.py", line 260, in get_password_for_storage_encryption
    xpub = self.get_xpub(derivation, "standard")
  File "/home/user/wspace/electrum/electrum/plugin.py", line 523, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "/home/user/wspace/electrum/electrum/plugin.py", line 513, in run_in_hwd_thread
    return func()
  File "/home/user/wspace/electrum/electrum/plugins/trezor/clientbase.py", line 150, in get_xpub
    with self.run_flow(creating_wallet=creating):
  File "/home/user/wspace/electrum/electrum/plugins/trezor/clientbase.py", line 89, in __exit__
    self.end_flow()
  File "/home/user/wspace/electrum/electrum/plugins/trezor/clientbase.py", line 82, in end_flow
    self.handler.finished()
AttributeError: 'NoneType' object has no attribute 'finished'
```
2024-10-14 16:08:52 +00:00
2024-10-14 16:07:55 +00:00
2021-09-13 16:20:54 +00:00
2022-08-10 17:32:23 +02:00
2023-08-30 16:47:37 +00:00
2023-09-05 12:32:38 +00:00
2024-02-21 16:12:22 +00:00
2024-10-14 15:38:31 +00:00
2024-02-19 12:00:08 +00:00
2024-10-14 12:35:06 +02:00
2023-11-13 15:45:05 +00:00
2024-02-16 15:40:45 +01:00

Electrum - Lightweight Bitcoin client

Licence: MIT Licence
Author: Thomas Voegtlin
Language: Python (>= 3.8)
Homepage: https://electrum.org/

Build Status Test coverage statistics Help translate Electrum online

Getting started

(If you've come here looking to simply run Electrum, you may download it here.)

Electrum itself is pure Python, and so are most of the required dependencies, but not everything. The following sections describe how to run from source, but here is a TL;DR:

$ sudo apt-get install libsecp256k1-dev
$ python3 -m pip install --user ".[gui,crypto]"

Not pure-python dependencies

If you want to use the Qt interface, install the Qt dependencies:

$ sudo apt-get install python3-pyqt5

For elliptic curve operations, libsecp256k1 is a required dependency:

$ sudo apt-get install libsecp256k1-dev

Alternatively, when running from a cloned repository, a script is provided to build libsecp256k1 yourself:

$ sudo apt-get install automake libtool
$ ./contrib/make_libsecp256k1.sh

Due to the need for fast symmetric ciphers, cryptography is required. Install from your package manager (or from pip):

$ sudo apt-get install python3-cryptography

If you would like hardware wallet support, see this.

Running from tar.gz

If you downloaded the official package (tar.gz), you can run Electrum from its root directory without installing it on your system; all the pure python dependencies are included in the 'packages' directory. To run Electrum from its root directory, just do:

$ ./run_electrum

You can also install Electrum on your system, by running this command:

$ sudo apt-get install python3-setuptools python3-pip
$ python3 -m pip install --user .

This will download and install the Python dependencies used by Electrum instead of using the 'packages' directory. It will also place an executable named electrum in ~/.local/bin, so make sure that is on your PATH variable.

Development version (git clone)

(For OS-specific instructions, see here for Windows, and for macOS)

Check out the code from GitHub:

$ git clone https://github.com/spesmilo/electrum.git
$ cd electrum
$ git submodule update --init

Run install (this should install dependencies):

$ python3 -m pip install --user -e .

Create translations (optional):

$ sudo apt-get install python3-requests gettext qttools5-dev-tools
$ ./contrib/pull_locale

Finally, to start Electrum:

$ ./run_electrum

Run tests

Run unit tests with pytest:

$ pytest tests -v

To run a single file, specify it directly like this:

$ pytest tests/test_bitcoin.py -v

Creating Binaries

Contributing

Any help testing the software, reporting or fixing bugs, reviewing pull requests and recent changes, writing tests, or helping with outstanding issues is very welcome. Implementing new features, or improving/refactoring the codebase, is of course also welcome, but to avoid wasted effort, especially for larger changes, we encourage discussing these on the issue tracker or IRC first.

Besides GitHub, most communication about Electrum development happens on IRC, in the #electrum channel on Libera Chat. The easiest way to participate on IRC is with the web client, web.libera.chat.

Languages
Python 89.1%
QML 8.4%
Shell 2%
Dockerfile 0.2%
Java 0.2%
Other 0.1%