Add development guide

This commit is contained in:
Maria 2022-05-13 07:32:02 -04:00 committed by accumulator
parent d40cebfad6
commit 5c39777eb3
2 changed files with 65 additions and 1 deletions

63
DEVELOPMENT-GUIDE.md Normal file
View file

@ -0,0 +1,63 @@
# Development guide
Opinionated guide for getting started developing on charge-lnd.
Requirements:
- Linux (used for this guide)
- LND node (for testing changes)
## Virtual environment
Libraries will need to be installed in order for charge-lnd to work. Create a virtual environment so the libraries can be installed.
First create the virtual environment.
```
python -m venv ./venv
```
Make sure your Python version is Python 3.
Enter the virtual environment.
```
source venv/bin/activate
```
Or use the `activate` which works for your terminal such as `activate.fish` for the fish terminal.
Install charge-lnd with requirements.
```
pip install -f requirements.txt .
```
Test to see if charge-lnd is basically working.
```
./venv/bin/charge-lnd --help
```
## Reinstall charge-lnd when source files change
Every time a source file is changed, the charge-lnd script will need to be installed again.
```
pip install .
```
For quicker development feedback, it is recommended to build/install the changes right away after source files changes. On Linux `entr` command can be used to watch for source file changes.
```
find charge_lnd -name '*.py' | entr -s 'pip install .'
```
Make sure your terminal is in the virtual environment or the pip command won't work.
## Test changes
There are currently no automated test for charge-lnd so manual testing is required. If you are testing against your own node, use `--dry-run` to avoid making unnecessary changes. A macaroon can also be created without the `offchain:write` permission. See [INSTALL.md](INSTALL.md) for details on creating a macaroon.
After getting your nodes tls certificate, creating your macaroon for charge-lnd and creating a test config file, a test command can be run against your own node.
```
./venv/bin/charge-lnd --tlscert tls.cert --macaroon charge-lnd.macaroon --grpc mynode.domain:10009 --dry-run -c charge-lnd.config
```

View file

@ -189,7 +189,8 @@ All strategies (except the ignore strategy) will apply the following properties
## Contributing
Contributions are highly welcome!
Feel free to submit issues and pull requests on https://github.com/accumulator/charge-lnd/
Feel free to [submit issues](https://github.com/accumulator/charge-lnd/issues) and [pull requests](https://github.com/accumulator/charge-lnd/pulls).
See [development guide](DEVELOPMENT-GUIDE.md) for help getting started.
Please also consider opening a channel with my node, or sending tips via keysend: