Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 1.9 KB

developer-notes.md

File metadata and controls

58 lines (36 loc) · 1.9 KB

Developer notes for Electrum Personal Server

Please keep lines under 80 characters in length and ideally don't add any external dependencies to keep this as easy to install as possible.

The project tries to follow the python style guide PEP 8.

Naming

Do not use the acronym EPS. Acronyms are not very user-friendly and are hard to search for.

Installing in developer mode

To seamlessly work on the codebase while using pip, you need to install in the develop/editable mode. You can do that with:

$ pip3 install --user -e /path/to/repo

/path/to/repo can also be a relative path, so if you are in the source directory, just use .. This installs the scripts in the usual places, but imports the package from the source directory. This way, any changes you make are immediately visible.

Testing

Electrum Personal Server also works on testnet and regtest. The Electrum wallet can be started in testnet mode with the command line flag --testnet or --regtest.

pytest is used for automated testing. On Debian-like systems install with pip3 install pytest pytest-cov

Run the tests with:

$ PYTHONPATH=.:$PYTHONPATH pytest

Create the coverage report with:

$ PYTHONPATH=.:$PYTHONPATH pytest --cov-report=html --cov
$ open htmlcov/index.html

If you have installed Electrum Personal Server with pip, there is no need to set PYTHONPATH. You could also run the tests with:

$ python3 setup.py test

Packaged binary release with pyinstaller

Pyinstaller is used to create the packaged binary releases. To build run:

pyinstaller common.spec

This is best done on a virtual machine with the target OS installed. The cert/ directory needs to be copied and for windows its helpful to run unix2dos config.ini_sample to convert the line endings.