Example log: app tries to auto-open to wallet "test_segwit_2", which has too new db version, then user manually tries to open wallet "test_segwit_3" instead, which opens okay but - immediately after - the process shuts down (due to line 383 -> line 458). ``` $ ./run_electrum -v --testnet -o 0.59 | I | simple_config.SimpleConfig | electrum directory /home/user/.electrum/testnet 0.59 | I | logging | Electrum version: 4.3.4 - https://electrum.org - https://github.com/spesmilo/electrum 0.59 | I | logging | Python version: 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]. On platform: Linux-5.15.0-58-generic-x86_64-with-glibc2.35 0.59 | I | logging | Logging to file: /home/user/.electrum/testnet/logs/electrum_log_20230202T151759Z_220451.log 0.59 | I | logging | Log filters: verbosity '*', verbosity_shortcuts '' 0.59 | I | p/plugin.Plugins | registering hardware bitbox02: ('hardware', 'bitbox02', 'BitBox02') 0.59 | I | p/plugin.Plugins | registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet') 0.59 | I | p/plugin.Plugins | registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet') 0.60 | I | p/plugin.Plugins | registering hardware jade: ('hardware', 'jade', 'Jade wallet') 0.60 | I | p/plugin.Plugins | registering hardware keepkey: ('hardware', 'keepkey', 'KeepKey wallet') 0.60 | I | p/plugin.Plugins | registering hardware ledger: ('hardware', 'ledger', 'Ledger wallet') 1.74 | I | p/plugin.Plugins | loaded payserver 1.74 | I | p/plugin.Plugins | registering hardware safe_t: ('hardware', 'safe_t', 'Safe-T mini wallet') 1.74 | I | p/plugin.Plugins | registering hardware trezor: ('hardware', 'trezor', 'Trezor wallet') 1.74 | I | p/plugin.Plugins | registering wallet type ('2fa', 'trustedcoin') 1.74 | D | util.profiler | Plugins.__init__ 1.1522 sec 1.74 | I | exchange_rate.FxThread | using exchange CoinGecko 1.75 | D | util.profiler | Daemon.__init__ 0.0033 sec 1.75 | I | daemon.Daemon | starting taskgroup. 1.75 | I | daemon.Daemon | launching GUI: qt 1.75 | I | gui.qt.ElectrumGui | Qt GUI starting up... Qt=5.15.3, PyQt=5.15.6 1.75 | I | daemon.CommandsServer | now running and listening. socktype=unix, addr=/home/user/.electrum/testnet/daemon_rpc_socket Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. 2.04 | D | util.profiler | ElectrumGui.__init__ 0.2865 sec 2.04 | I | storage.WalletStorage | wallet path /home/user/.electrum/testnet/wallets/test_segwit_2 2.13 | I | storage.WalletStorage | wallet path /home/user/.electrum/testnet/wallets/test_segwit_2 5.24 | E | gui.qt.ElectrumGui | Traceback (most recent call last): File "/home/user/wspace/electrum/electrum/gui/qt/__init__.py", line 354, in start_new_window wallet = self._start_wizard_to_select_or_create_wallet(path) File "/home/user/wspace/electrum/electrum/gui/qt/__init__.py", line 401, in _start_wizard_to_select_or_create_wallet db = WalletDB(storage.read(), manual_upgrades=False) File "/home/user/wspace/electrum/electrum/wallet_db.py", line 72, in __init__ self.load_data(raw) File "/home/user/wspace/electrum/electrum/wallet_db.py", line 102, in load_data if not self.requires_upgrade(): File "/home/user/wspace/electrum/electrum/wallet_db.py", line 153, in requires_upgrade return self.get_seed_version() < FINAL_SEED_VERSION File "/home/user/wspace/electrum/electrum/json_db.py", line 44, in wrapper return func(self, *args, **kwargs) File "/home/user/wspace/electrum/electrum/wallet_db.py", line 1035, in get_seed_version raise WalletFileException('This version of Electrum is too old to open this wallet.\n' electrum.util.WalletFileException: This version of Electrum is too old to open this wallet. (highest supported storage version: 50, version of this file: 51) 5.35 | I | storage.WalletStorage | wallet path /home/user/.electrum/testnet/wallets/wallet_20 7.90 | I | storage.WalletStorage | wallet path /home/user/.electrum/testnet/wallets/test_segwit_3 8.48 | D | util.profiler | WalletDB._load_transactions 0.0517 sec 8.48 | D | util.profiler | AddressSynchronizer.load_local_history 0.0005 sec 8.48 | D | util.profiler | AddressSynchronizer.check_history 0.0005 sec 8.70 | D | util.profiler | AddressList.update 0.0000 sec 9.00 | D | util.profiler | Deterministic_Wallet.try_detecting_internal_addresses_corruption 0.0223 sec 9.01 | D | util.profiler | ElectrumWindow.load_wallet 0.0808 sec 9.01 | I | daemon.Daemon | stop() entered. initiating shutdown 9.01 | I | gui.qt.ElectrumGui | closing GUI 9.01 | I | daemon.Daemon | stopping all wallets 9.04 | I | storage.WalletStorage | saved /home/user/.electrum/testnet/wallets/test_segwit_3 9.04 | D | util.profiler | WalletDB._write 0.0265 sec 9.04 | I | daemon.Daemon | stopping network and taskgroup 9.04 | I | daemon.Daemon | taskgroup stopped. 9.04 | I | daemon.Daemon | removing lockfile 9.04 | I | daemon.Daemon | stopped 9.08 | I | p/plugin.Plugins | stopped QThread: Destroyed while thread is still running Aborted (core dumped) ```
Electrum - Lightweight Bitcoin client
Licence: MIT Licence
Author: Thomas Voegtlin
Language: Python (>= 3.8)
Homepage: https://electrum.org/
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-0
$ 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-0
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 electrum/tests -v
To run a single file, specify it directly like this:
$ pytest electrum/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.