| 1 | # Electrum - Lightweight Bitcoin client |
| 2 | |
| 3 | ``` |
| 4 | Licence: MIT Licence |
| 5 | Author: Thomas Voegtlin |
| 6 | Language: Python (>= 3.10) |
| 7 | Homepage: https://electrum.org/ |
| 8 | ``` |
| 9 | |
| 10 | [](https://github.com/spesmilo/electrum/actions/workflows/builds.yml) |
| 11 | [](https://coveralls.io/github/spesmilo/electrum?branch=master) |
| 12 | [](https://crowdin.com/project/electrum) |
| 13 | |
| 14 | |
| 15 | ## Getting started |
| 16 | |
| 17 | _(If you've come here looking to simply run Electrum, |
| 18 | [you may download it here](https://electrum.org/#download).)_ |
| 19 | |
| 20 | Electrum itself is pure Python, and so are most of the required dependencies, |
| 21 | but not everything. The following sections describe how to run from source, but here |
| 22 | is a TL;DR: |
| 23 | |
| 24 | ``` |
| 25 | $ sudo apt-get install libsecp256k1-dev |
| 26 | $ ELECTRUM_ECC_DONT_COMPILE=1 python3 -m pip install --user ".[gui,crypto]" |
| 27 | ``` |
| 28 | |
| 29 | ### Not pure-python dependencies |
| 30 | |
| 31 | #### Qt GUI |
| 32 | |
| 33 | If you want to use the Qt interface, install the Qt dependencies: |
| 34 | ``` |
| 35 | $ sudo apt-get install python3-pyqt6 |
| 36 | ``` |
| 37 | |
| 38 | #### libsecp256k1 |
| 39 | |
| 40 | For elliptic curve operations, |
| 41 | [libsecp256k1](https://github.com/bitcoin-core/secp256k1) |
| 42 | is a required dependency. |
| 43 | |
| 44 | If you "pip install" Electrum, by default libsecp will get compiled locally, |
| 45 | as part of the `electrum-ecc` dependency. This can be opted-out of, |
| 46 | by setting the `ELECTRUM_ECC_DONT_COMPILE=1` environment variable. |
| 47 | For the compilation to work, besides a C compiler, you need at least: |
| 48 | ``` |
| 49 | $ sudo apt-get install automake libtool |
| 50 | ``` |
| 51 | If you opt out of the compilation, you need to provide libsecp in another way, e.g.: |
| 52 | ``` |
| 53 | $ sudo apt-get install libsecp256k1-dev |
| 54 | ``` |
| 55 | |
| 56 | #### cryptography |
| 57 | |
| 58 | Due to the need for fast symmetric ciphers, |
| 59 | [cryptography](https://github.com/pyca/cryptography) is required. |
| 60 | Install from your package manager (or from pip): |
| 61 | ``` |
| 62 | $ sudo apt-get install python3-cryptography |
| 63 | ``` |
| 64 | |
| 65 | #### hardware-wallet support |
| 66 | |
| 67 | If you would like hardware wallet support, |
| 68 | [see this](https://github.com/spesmilo/electrum-docs/blob/master/hardware-linux.rst). |
| 69 | |
| 70 | |
| 71 | ### Running from tar.gz |
| 72 | |
| 73 | If you downloaded the official package (tar.gz), you can run |
| 74 | Electrum from its root directory without installing it on your |
| 75 | system; all the pure python dependencies are included in the 'packages' |
| 76 | directory. To run Electrum from its root directory, just do: |
| 77 | ``` |
| 78 | $ ./run_electrum |
| 79 | ``` |
| 80 | |
| 81 | You can also install Electrum on your system, by running this command: |
| 82 | ``` |
| 83 | $ sudo apt-get install python3-setuptools python3-pip |
| 84 | $ python3 -m pip install --user . |
| 85 | ``` |
| 86 | |
| 87 | This will download and install the Python dependencies used by |
| 88 | Electrum instead of using the 'packages' directory. |
| 89 | It will also place an executable named `electrum` in `~/.local/bin`, |
| 90 | so make sure that is on your `PATH` variable. |
| 91 | |
| 92 | |
| 93 | ### Development version (git clone) |
| 94 | |
| 95 | _(For OS-specific instructions, see [here for Windows](contrib/build-wine/README_windows.md), |
| 96 | and [for macOS](contrib/osx/README_macos.md))_ |
| 97 | |
| 98 | Check out the code from GitHub: |
| 99 | ``` |
| 100 | $ git clone https://github.com/spesmilo/electrum.git |
| 101 | $ cd electrum |
| 102 | $ git submodule update --init |
| 103 | ``` |
| 104 | |
| 105 | Run install (this should install dependencies): |
| 106 | ``` |
| 107 | $ python3 -m pip install --user -e . |
| 108 | ``` |
| 109 | |
| 110 | Create translations (optional): |
| 111 | ``` |
| 112 | $ sudo apt-get install gettext |
| 113 | $ ./contrib/locale/build_locale.sh electrum/locale/locale electrum/locale/locale |
| 114 | ``` |
| 115 | |
| 116 | Finally, to start Electrum: |
| 117 | ``` |
| 118 | $ ./run_electrum |
| 119 | ``` |
| 120 | |
| 121 | ### Run tests |
| 122 | |
| 123 | Run unit tests with `pytest`: |
| 124 | ``` |
| 125 | $ pytest tests -v |
| 126 | ``` |
| 127 | (can be parallelized with `-n auto` option, using [`pytest-xdist`](https://github.com/pytest-dev/pytest-xdist) plugin) |
| 128 | |
| 129 | To run a single file, specify it directly like this: |
| 130 | ``` |
| 131 | $ pytest tests/test_bitcoin.py -v |
| 132 | ``` |
| 133 | |
| 134 | ## Creating Binaries |
| 135 | |
| 136 | - [Linux (tarball)](contrib/build-linux/sdist/README.md) |
| 137 | - [Linux (AppImage)](contrib/build-linux/appimage/README.md) |
| 138 | - [macOS](contrib/osx/README.md) |
| 139 | - [Windows](contrib/build-wine/README.md) |
| 140 | - [Android](contrib/android/Readme.md) |
| 141 | |
| 142 | |
| 143 | ## Contributing |
| 144 | |
| 145 | Any help testing the software, reporting or fixing bugs, reviewing pull requests |
| 146 | and recent changes, writing tests, or helping with outstanding issues is very welcome. |
| 147 | Implementing new features, or improving/refactoring the codebase, is of course |
| 148 | also welcome, but to avoid wasted effort, especially for larger changes, |
| 149 | we encourage discussing these on the issue tracker or IRC first. |
| 150 | |
| 151 | Besides [GitHub](https://github.com/spesmilo/electrum), |
| 152 | most communication about Electrum development happens on IRC, in the |
| 153 | `#electrum` channel on Libera Chat. The easiest way to participate on IRC is |
| 154 | with the web client, [web.libera.chat](https://web.libera.chat/#electrum). |
| 155 | |
| 156 | Please improve translations on [Crowdin](https://crowdin.com/project/electrum). |