fusion44 / fort-bitcoin-gql

A GraphQL server for the Fort Bitcoin project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bitcoin CLI GraphQL API

The GraphQL server for the Fort Bitcoin project. This server aims to make it simpler to run and manage a Bitcoin full node and multiple Lightning nodes for multiple users.

There is an App in development to accompany the component.

Prerequisites

You'll need to have Python3 and pip installed.

Getting started

Virtualenvwrapper must be working properly on your system before continuing.

  • clone the repository
  • copy config.ini.sample to config.ini and adapt the values to your requirements
  • add a new virtual environment: mkvirtualenv fort-bitcoin-gql
  • pip install -r requirements.txt
  • deactivate virtual environment to prevent some errors deactivate
  • use the environment: workon fort-bitcoin-gql
  • ./manage.py makemigrations
  • ./manage.py migrate
  • ./manage.py runserver

Open http://localhost:8000/graphql to explore the available queries via GraphiQL.

RabbitMQ

For Celery you'll have to run a Broker which keeps background tasks going. Easiest way is to run RabbitMQ via Docker:

  • docker pull rabbitmq
  • docker run --name rabbitmq --hostname fbtc-rabbitmq --restart=unless-stopped -d -p 5672:5672 -p 15672:15672 -v /chose/your/path/logs:/data/log -v /chose/your/path/data:/data/mnesia rabbitmq
  • open config.ini and adjust celery_broker_url. If you run it on localhost and you kept the standard port of 5672 you can just keep the value at amqp://localhost//

There are other options than RabbitMQ, see the docs

Celery

Run celery in screen or two new terminals. Make sure the virtual environment is applied and your are in the base folder of the project before running these commands.

  • celery worker -A backend --concurrency=4
  • celery -A backend beat -l debug --scheduler django_celery_beat.schedulers:DatabaseScheduler

License

This project is licensed under the MPL 2.0 License - see the LICENSE file for details

About

A GraphQL server for the Fort Bitcoin project.

License:Mozilla Public License 2.0


Languages

Language:Python 100.0%