No description
Find a file
2022-01-15 14:29:55 +01:00
.github/workflows chore: exclude lnd grpc files from code scanning 2021-08-14 13:08:34 +02:00
.vscode chore: update vscode config files 2021-10-02 10:01:43 +02:00
app refactor: rename wallet balance update function 2022-01-15 14:29:55 +01:00
scripts feat: add sync to blitz make target 2021-12-05 21:14:25 +01:00
tests feat: implement basic fee revenue endpoint 2022-01-09 20:20:21 +01:00
.coveragerc test: Add testing dependencies and first tests 2021-10-02 12:00:44 +02:00
.env_sample feat: implement forward success SSE notifications 2022-01-15 14:27:08 +01:00
.gitignore test: Add testing dependencies and first tests 2021-10-02 12:00:44 +02:00
LICENSE Create LICENSE 2021-09-23 21:03:34 +02:00
Makefile feat: add sync to blitz make target 2021-12-05 21:14:25 +01:00
poetry.lock chore: update dependencies 2021-11-18 11:01:26 +01:00
pyproject.toml fix: install problem due to include from git repo 2021-11-18 08:31:46 +01:00
README.md docs: simplify and rework readme 2021-12-05 16:32:51 +08:00
requirements.txt chore: update dependencies 2021-11-18 11:01:26 +01:00

blitz_api

Configuration

Create a .env file with your bitcoind and lnd configuration. See the .env_sample file for all configuration options.

Dependencies

Installation

⚠️ To setup a development environment for BlitzAPI skip to the Development section.

Linux / macOS

make install

or

python -m pip install -r requirements.txt

Windows

py -m pip install -r requirements.txt

Run the application

Linux / macOS

make run

or

python -m uvicorn app.main:app --reload

Windows

py -m uvicorn app.main:app --reload

Development

It is recommended to have python-poetry installed.

From within the blitz_api folder open a poetry shell via:

poetry shell

(To exit the poetry shell use: exit)

Installation

poetry install

or

make install_dev

If python dependencies have been changed it's necessary to freeze all requirements to requirements.txt:

poetry export -f requirements.txt --output requirements.txt

This will skip all dev dependencies by default.
This step is required to avoid having to install poetry for final deployment.

Testing

Make sure to include tests for important pieces of submitted code.

Run the tests with pytest

make tests

Run tests and generate a coverage

make coverage

This will run tests and generate a coverage html file in this folder: ./htmlcov

Swagger

Once the API is running swagger docs can be found here:

http://127.0.0.1:8000/latest/docs

Useful cURL commands to test the API

curl -N http://127.0.0.1:8000/v1/sse/subscribe
curl -N http://127.0.0.1:8000/v1/bitcoin/getblockchaininfo
curl -X POST -N http://127.0.0.1:8000/v1/setup/type/1
curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"password":"12345678"}' \
  http://127.0.0.1:8000/system/login

Acknowledgements

Integrated Libraries: