Create a .env
file with your bitcoind
and lnd
configuration. See the .env_sample
file for all configuration options.
- Python in version 3.7
- Redis
- Polar
If you need an easy option to run a simple bitcoind & lnd client
make install
or
python -m pip install -r requirements.txt
py -m pip install -r requirements.txt
make run
or
python -m uvicorn app.main:app --reload
py -m uvicorn app.main:app --reload
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
)
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.
Make sure to include tests for important pieces of submitted code.
make tests
make coverage
This will run tests and generate a coverage html file in this folder: ./htmlcov
Once the API is running swagger docs can be found here:
http://127.0.0.1:8000/latest/docs
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
Integrated Libraries: