2020-05-04 17:20:36 +02:00
|
|
|
---
|
|
|
|
layout: default
|
|
|
|
title: For developers
|
2020-09-03 19:53:22 +02:00
|
|
|
nav_order: 4
|
2020-05-04 17:20:36 +02:00
|
|
|
has_children: true
|
|
|
|
---
|
|
|
|
|
2024-04-25 11:13:08 +02:00
|
|
|
# For developers
|
2020-05-04 17:20:36 +02:00
|
|
|
|
|
|
|
Thanks for contributing :)
|
2021-11-17 17:53:32 +01:00
|
|
|
|
2024-04-25 11:13:08 +02:00
|
|
|
# Run
|
2023-08-03 09:53:36 +02:00
|
|
|
|
2024-08-30 13:18:42 +02:00
|
|
|
Follow the [Basic installation: Option 1 (recommended): poetry](https://docs.lnbits.org/guide/installation.html#option-1-recommended-poetry)
|
|
|
|
guide to install poetry and other dependencies.
|
|
|
|
|
|
|
|
Then you can start LNbits uvicorn server with:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2023-08-03 09:53:36 +02:00
|
|
|
```bash
|
|
|
|
poetry run lnbits
|
|
|
|
```
|
|
|
|
|
2024-08-30 13:18:42 +02:00
|
|
|
Or you can use the following to start uvicorn with hot reloading enabled:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2023-08-03 09:53:36 +02:00
|
|
|
```bash
|
|
|
|
make dev
|
|
|
|
# or
|
|
|
|
poetry run lnbits --reload
|
|
|
|
```
|
|
|
|
|
2024-08-30 13:18:42 +02:00
|
|
|
You might need the following extra dependencies on clean installation of Debian:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt install nodejs
|
|
|
|
sudo apt install npm
|
|
|
|
npm install
|
|
|
|
sudo apt-get install autoconf libtool libpg-dev
|
|
|
|
```
|
|
|
|
|
2024-04-25 11:13:08 +02:00
|
|
|
# Precommit hooks
|
2023-06-20 08:41:23 +02:00
|
|
|
|
|
|
|
This ensures that all commits adhere to the formatting and linting rules.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
make install-pre-commit-hook
|
|
|
|
```
|
|
|
|
|
2024-04-25 11:13:08 +02:00
|
|
|
# Tests
|
2021-11-17 17:53:32 +01:00
|
|
|
|
|
|
|
This project has unit tests that help prevent regressions. Before you can run the tests, you must install a few dependencies:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2021-11-17 17:53:32 +01:00
|
|
|
```bash
|
2022-08-03 14:10:32 +02:00
|
|
|
poetry install
|
|
|
|
npm i
|
2021-11-17 17:53:32 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Then to run the tests:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2021-11-17 17:53:32 +01:00
|
|
|
```bash
|
|
|
|
make test
|
|
|
|
```
|
2022-08-03 14:10:32 +02:00
|
|
|
|
|
|
|
Run formatting:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2022-08-03 14:10:32 +02:00
|
|
|
```bash
|
|
|
|
make format
|
|
|
|
```
|
|
|
|
|
|
|
|
Run mypy checks:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2022-08-03 14:10:32 +02:00
|
|
|
```bash
|
|
|
|
poetry run mypy
|
|
|
|
```
|
|
|
|
|
|
|
|
Run everything:
|
2024-04-25 11:13:08 +02:00
|
|
|
|
2022-08-03 14:10:32 +02:00
|
|
|
```bash
|
|
|
|
make all
|
|
|
|
```
|