mirror of
https://github.com/accumulator/charge-lnd.git
synced 2026-08-13 12:33:01 +02:00
Add development guide
This commit is contained in:
parent
d40cebfad6
commit
5c39777eb3
2 changed files with 65 additions and 1 deletions
63
DEVELOPMENT-GUIDE.md
Normal file
63
DEVELOPMENT-GUIDE.md
Normal 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
|
||||
```
|
||||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue