diff --git a/DEVELOPMENT-GUIDE.md b/DEVELOPMENT-GUIDE.md new file mode 100644 index 0000000..b43c7c5 --- /dev/null +++ b/DEVELOPMENT-GUIDE.md @@ -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 +``` diff --git a/README.md b/README.md index 55353e9..44df9d2 100644 --- a/README.md +++ b/README.md @@ -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: