WARNING: Currently this project primarily targets Lightning Node Daemon (LND) implementation
Run the server using uvicorn
Uvicorn is an ASGI web server implementation for Python with great compatibility with the chosen framework for this project, FastAPI.
In order to run this server, you must set the following environment variables to your local shell
with export command or by creating .env file if you are running with development dependencies
installed:
DATABASE_URL=postgres://localhost:5432/tesladb # default
LND_HOST_URL=localhost:10009 # default
LND_MACAROON_PATH=/Users/path/to/admin.macaroon # TODO: probably don't need admin-level permission
LND_TLSCERT_PATH=/Users/path/to/tls.certAfter successfully defining environment variables required, you can then run the server with the following command:
$ uvicorn serve:app --log-config log_conf.ymlThis project uses poetry package manager to keep track of dependencies. You can set up your local environment as such
$ pip install --user poetry
> ...
$ poetry install --with dev # install with development dependencies
> Installing dependencies from lock file
>
> Package operations: 41 installs, 1 update, 0 removals
>
> • ...
> • ...
> • ...
> • ...
>
> Installing the current project: tesla-ball (0.1.0)No idea why this happens when installing grpcio-tool using poetry
but you can just download without rebuilding from source on M1/M2 MacBooks as such
$ conda install grpcio-tools # if using Anaconda3 / Miniconda3 for virtual environmentAnd turn them to Python modules at ~~/src/protos by using the following command
$ poetry run compile-protosNow you can begin contributing code and logic to the project.
Uvicorn allows you to run the ASGI application with hot-reload enabled by adding --reload flag
to the command as such:
$ uvicorn serve:app --log-config log_conf.yml --reloadThis project is licensed under the terms of the MIT license.