commands: add "version_info" cmd
example:
```
$ ./run_electrum -o version_info
{
"aiohttp.version": "3.8.1",
"aiorpcx.version": "0.22.1",
"certifi.version": "2021.10.08",
"cryptodome.version": null,
"cryptography.path": "/home/user/.local/lib/python3.8/site-packages/cryptography",
"cryptography.version": "3.4.6",
"dnspython.version": "2.2.0",
"electrum.path": "/home/user/wspace/electrum/electrum",
"electrum.version": "4.2.1",
"hidapi.version": "0.11.0.post2",
"libsecp256k1.path": "/home/user/wspace/electrum/electrum/libsecp256k1.so.0",
"libusb.path": "libusb-1.0.so",
"libusb.version": "1.0.23.11397",
"libzbar.path": "/home/user/wspace/electrum/electrum/libzbar.so.0",
"pyaes.version": "1.3.0",
"pyqt.path": "/usr/lib/python3/dist-packages/PyQt5",
"pyqt.version": "5.14.1",
"qt.version": "5.12.8"
}
```
This commit is contained in:
@@ -38,6 +38,7 @@ from functools import wraps, partial
|
||||
from itertools import repeat
|
||||
from decimal import Decimal
|
||||
from typing import Optional, TYPE_CHECKING, Dict, List
|
||||
import os
|
||||
|
||||
from .import util, ecc
|
||||
from .util import (bfh, bh2u, format_satoshis, json_decode, json_normalize,
|
||||
@@ -57,11 +58,13 @@ from .lnutil import SENT, RECEIVED
|
||||
from .lnutil import LnFeatures
|
||||
from .lnutil import extract_nodeid
|
||||
from .lnpeer import channel_id_from_funding_tx
|
||||
from .plugin import run_hook
|
||||
from .plugin import run_hook, DeviceMgr
|
||||
from .version import ELECTRUM_VERSION
|
||||
from .simple_config import SimpleConfig
|
||||
from .invoices import LNInvoice
|
||||
from . import submarine_swaps
|
||||
from . import GuiImportError
|
||||
from . import crypto
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -546,9 +549,45 @@ class Commands:
|
||||
@command('')
|
||||
async def version(self):
|
||||
"""Return the version of Electrum."""
|
||||
from .version import ELECTRUM_VERSION
|
||||
return ELECTRUM_VERSION
|
||||
|
||||
@command('')
|
||||
async def version_info(self):
|
||||
"""Return information about dependencies, such as their version and path."""
|
||||
ret = {
|
||||
"electrum.version": ELECTRUM_VERSION,
|
||||
"electrum.path": os.path.dirname(os.path.realpath(__file__)),
|
||||
}
|
||||
# add currently running GUI
|
||||
if self.daemon and self.daemon.gui_object:
|
||||
ret.update(self.daemon.gui_object.version_info())
|
||||
# always add Qt GUI, so we get info even when running this from CLI
|
||||
try:
|
||||
from .gui.qt import ElectrumGui as QtElectrumGui
|
||||
ret.update(QtElectrumGui.version_info())
|
||||
except GuiImportError:
|
||||
pass
|
||||
# Add shared libs (.so/.dll), and non-pure-python dependencies.
|
||||
# Such deps can be installed in various ways - often via the Linux distro's pkg manager,
|
||||
# instead of using pip, hence it is useful to list them for debugging.
|
||||
from . import ecc_fast
|
||||
ret.update(ecc_fast.version_info())
|
||||
from . import qrscanner
|
||||
ret.update(qrscanner.version_info())
|
||||
ret.update(DeviceMgr.version_info())
|
||||
ret.update(crypto.version_info())
|
||||
# add some special cases
|
||||
import aiohttp
|
||||
ret["aiohttp.version"] = aiohttp.__version__
|
||||
import aiorpcx
|
||||
ret["aiorpcx.version"] = aiorpcx._version_str
|
||||
import certifi
|
||||
ret["certifi.version"] = certifi.__version__
|
||||
import dns
|
||||
ret["dnspython.version"] = dns.__version__
|
||||
|
||||
return ret
|
||||
|
||||
@command('w')
|
||||
async def getmpk(self, wallet: Abstract_Wallet = None):
|
||||
"""Get master public key. Return your wallet\'s master public key"""
|
||||
|
||||
Reference in New Issue
Block a user