GaloyMoney / blink

bitcoin banking infrastructure
https://galoy.io
MIT License
363 stars 138 forks source link
bitcoin community-banking cryptocurrency lightning-network payments

Galoy

Mattermost GitHub Repo stars Twitter Follow

💡 Get help

Q&A or Mattermost 💬

TLDR

Galoy is an opinionated Bitcoin banking platform.

This repo represents the main API that brings all functionality together.

Responsible Disclosure

Found critical bugs/vulnerabilities? Please contact our team by email at security@galoy.io .

Get Started

Want to try it out and contribute? Check out the dev documentation to deploy locally with a docker-compose script.

If you have questions, you can join our Workspace

For an overview of all relevant repositories checkout awesome-galoy.

Galoy-Backend features

Local Development Setup

Running the Galoy software locally can be done in a variety of ways, but this abbreviated section will focus on a single method for getting your environment ready to run the stack. For more information and options on running Galoy locally, see the development environment documentation.

(1) Choose a Supported Platform

Currently developing on MacOS and Linux is supported.

(2) Install Dependencies

Install dependencies on your chosen platform.

For nix, we highly recommend using the Determinate Nix Installer.

For docker, the Docker Desktop version corresponding to your native architecture should be used.

For direnv, you can install it with your package manager of choice. However, if you're unsure which installation method to use or your package manager does not provide a compatible version, you can use nix itself (e.g. nix profile install nixpkgs#direnv).

We recommend using the upstream docs for hooking direnv into your shell, but here is an example on how to do it on a system where zsh is the default shell. In this example, the following is added to the end of ~/.zshrc.

if [ $(command -v direnv) ]; then
   eval "$(direnv hook zsh)"
fi

(3) Enter the Repository Directory

All commands need to be run from the nix environment. Since direnv is installed and hooked into your shell, you can cd into the repository and nix will bootstrap the environment for you using the flake.

Please note: you may notice a large download of dependencies when entering the repository for the first time.

(4) Running the Stack

We use buck2 to run the stack, run and build individual services and libraries, perform lints and tests, etc.

_Before continuing, you should stop any locally running services to avoid conflicting ports with the stack. Some of the services that will run include, but are not limited to the following: PostgreSQL, OpenTelemetry, MongoDB.

Check if you are ready to run the stack before continuing.

buck2 run dev:healthcheck

You may notice some checks related to resource limits. On macOS and in WSL2 in particular, we recommend significantly increasing the file descriptor limit for buck2 to work as intended (e.g. ulimit -n 10240). Please note: the new file descriptor limit may not persist to future sessions.

Once ready, we can build relevant services and run the entire stack locally.

buck2 run dev:up

Once Tilt starts, you can check on the status of all services by accessing the UI through the given port on your local host (e.g. http://localhost:10350/). Every service should eventually have a green checkmark next to them, which ensures that they are in "ready" states.

(5) Test account credentials

For account login on regtest, you can input any random mobile number and then use 000000 as the OTP.

(6) Troubleshooting in Tilt

If some services fail to start, you can restart them on the Tilt dashboard.

(7) Tearing Down the Stack

The following command will stop all running services and containers. It will also remove the containers and, consequentially, the data held in them.

buck2 run dev:down

Run integration tests with Galoy as a dependency?

Take a look at the Quickstart if you want to take it for a spin.