Readme

From wiki.electroncash.de
Jump to navigation Jump to search

Electron Cash - Lightweight Bitcoin Cash client[edit]

Licence: MIT Licence

Author: Electron Cash Developers

Language: Python

Homepage: electroncash.org

Help translate Electron Cash online GitHub Actions Tests GitHub Actions Build GitHub Actions Python Audit


Getting started[edit]

Note: If running from source, Python 3.7 or above is required to run Electron Cash. If your system lacks Python 3.7, you have other options, such as the AppImage / binary releases or running from source using pyenv (see section Running from source on old Linux below).

macOS: It is recommended that macOS users run the binary .dmg as that's simpler to use and has everything included. Otherwise, if you want to run from source, see section Running from source on macOS below.

Electron Cash is a pure python application forked from Electrum. If you want to use the Qt interface, install the Qt dependencies:

sudo apt-get install python3-pyqt5 python3-pyqt5.qtsvg

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

./electron-cash

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

sudo apt-get install python3-setuptools
python3 setup.py install

Compile the icons file for Qt (normally you can skip this step, run this command if icons are missing):

sudo apt-get install pyqt5-dev-tools
pyrrc5 icons.qrc -o electroncash_gui/qt/icons.py


This will download and install the Python dependencies used by Electron Cash, instead of using the 'packages' directory.

If you cloned the git repository, you need to compile extra files before you can run Electron Cash. Read the next section, "Development Version."

Hardware Wallet - Ledger Nano S[edit]

Electron Cash natively supports Ledger Nano S hardware wallet. If you plan to use it, you need an additional dependency, namely btchip. To install it, run this command:

sudo pip3 install btchip-python

If you still have problems connecting to your Nano S, please have a look at this https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues section on Ledger website.

Development version[edit]

Check your python version >= 3.7, and install pyqt5, as instructed above in the Getting started section above or Running from source on old Linux section below.

If you are on macOS, see the Running from source on macOS section below.

Check out the code from Github:

git clone https://github.com/Electron-Cash/Electron-Cash
cd Electron-Cash

Install the python dependencies:

pip3 install -r contrib/requirements/requirements.txt --user

Create translations (optional):

sudo apt-get install python-requests gettext
./contrib/make_locale

Compile libsecp256k1 (optional, yet highly recommended):

sudo apt-get install libtool automake
./contrib/make_secp

For plugin development, see the plugin documentation.

Running unit tests (very optional, advanced users only):

pip install tox
tox

Tox will take care of building a faux installation environment, and ensure that the mapped import paths work correctly.

Running from source on old Linux[edit]

If your Linux distribution has a different version of python 3 (such as python 3.5 in Debian 9), it is recommended to do a user dir install with pyenv. This allows Electron Cash to run completely independently of your system configuration.

1. Install pyenv in your user account. Follow the printed instructions about updating your environment variables and ``.bashrc``, and restart your shell to ensure that they are loaded.

2. Run the following command to install Python 3.11.1. This will download and compile that version of python, storing it under ``.pyenv`` in your home directory:

pyenv install 3.11.1

3. Change to the Electron Cash directory and run the following command to set the Python version to 3.11.1, which inserts a file ``.python-version`` into the current directory:

cd Electron-Cash
pyenv local 3.11.1

4. While still in this directory, run the following command to install PyQt5:

pip install pyqt5

5. If you are installing from the source file (.tar.gz or .zip) then you are ready, and you may run Electron Cash using the following command. If you are using the git version, then continue by following the Development version instructions above:

./electron-cash

Running from source on macOS[edit]

You need to install either MacPorts or HomeBrew. Follow the instructions on either site for installing (Xcode from Apple's developer site is required for either).

1. After installing either HomeBrew or MacPorts, clone this repository and switch to the directory with the following commands:

git clone https://github.com/Electron-Cash/Electron-Cash
cd Electron-Cash

2. Install python 3.7 or later. For brew, use the following command:

brew install python3

Or, if using MacPorts, use:

sudo port install python311

3. Install PyQt5 by running the following command:

python3 -m pip install --user pyqt5

4. Install Electron Cash requirements with the following command:

python3 -m pip install --user -r contrib/requirements/requirements.txt

5. Compile libsecp256k1 (optional, yet highly recommended) using one of the following commands, depending on your package manager:

For HomeBrew:

./contrib/make_secp

For MacPorts:

sudo port install coreutils automake
./contrib/make_secp

6. At this point, you should be able to run the sources using the following command:

./electron-cash

Running from source on Windows[edit]

1. Download and install python 3.11.8 (Windows installer 32-bit)

2. Clone the GitHub repository with Git Bash or download the source code directly from GitHub and unpack it.

3. Press Win+R and start cmd.exe. Then enter the following commands:

cd Electron-Cash
"%LOCALAPPDATA%\Programs\Python\Python311-32\python.exe" -m venv env
.\env\Scripts\activate.bat
pip install -r contrib\requirements\requirements.txt
pip install -r contrib\requirements\requirements-binaries.txt
pip install -r contrib\requirements\requirements-hw.txt

4. Download the electroncash-4.3.1-setup.exe file. Open this file with 7-zip

5. Unpack the following files from the electroncash-4.3.1-setup.exe to the Electron-Cash source code directory and the Electron-Cash/electroncash directory

libsecp256k1-0.dll
libusb-1.0.dll
libzbar-0.dll
tor.exe

6. Go back to the cmd.exe window and start Electron Cash with:

python electron-cash

Notes: You need to replace cd Electron-Cash with the path to your Electron-Cash source code directory. You may need administrative rights to install 7-zip.

Creating Binaries[edit]

Linux AppImage & Source Tarball

See contrib/build-linux/README.md.

Mac OS X / macOS

See contrib/osx/.

Windows

See contrib/build-wine/.