xmr-btc-swap/swap-orchestrator
2025-08-24 23:29:51 +02:00
..
src fix(orchestrator): electrs takes bitcoin instead of mainnet as a value to the --network flag 2025-08-24 23:29:51 +02:00
tests feat: Orchestration & Controller (#492) 2025-08-06 15:33:41 +02:00
build.rs feat: Orchestration & Controller (#492) 2025-08-06 15:33:41 +02:00
Cargo.toml feat: Orchestration & Controller (#492) 2025-08-06 15:33:41 +02:00
README.md Update README.md 2025-08-08 00:31:07 +02:00

Orchestrator

The orchestrator tool helps you setup a secure, reliable and production environment for running an ASB. It guides you through a series of prompts to generate a customized Docker environment using Docker Compose.

Getting started

Ensure you have Docker and Docker Compose installed on your machine.

To generate the config.toml and docker-compose.yml files, run:

./orchestrator
cargo run --bin orchestrator

To start the environment, run a command such as:

docker compose up -d

To view logs, run commands such as:

docker compose logs -f --tail 100
docker compose logs -f --tail 100 asb
docker compose logs -f --tail 100 bitcoind

Once the asb is running properly you can get a shell

$ docker compose attach asb-controller

ASB Control Shell - Type 'help' for commands, 'quit' to exit

asb> help
Available commands:

Usage: <COMMAND>

Commands:
  check-connection    Check connection to ASB server
  bitcoin-balance     Get Bitcoin balance
  monero-balance      Get Monero balance
  monero-address      Get Monero wallet address
  multiaddresses      Get external multiaddresses
  active-connections  Get active connection count
  get-swaps           Get list of swaps
  help                Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help


Additional shell commands:
  help                 Show this help message
  quit, exit, :q       Exit the shell
asb>

Architecture

The orchestrator generates a docker-compose.yml file that includes the following containers:

  • asb: Accepts connections from the outside world. Provides sell offers to the outside world. Manages your Bitcoin and Monero wallet. Controls the swap process.
  • asb-controller: Shell to send control commands to the asb container.
  • bitcoind: Bitcoin node.
  • electrs: Electrum server.
  • monerod: Monero node.
image

Why Docker?

Your ASB will potentially be managing fairly large amounts of funds. This means you have to keep it secure and running reliably. Docker handles some of this for you.

Most importantly Docker provides:

  • System Isolation: Containers are isolated from each other on the operating system level. If one of the nodes were to be affected by a vulnerability, your funds are still safe.
  • Network Isolation: Docker only exposes the peer-to-peer port of your ASB to the outside world. Bitcoin, Monero and Electrum containers are only allowed outbound connections. The RPC control port of your ASB is only accessible within Docker inside of an internal network, accessible only to the asb-controller container.
  • Reproducibility: A virtual environment is created for each container. This means that quirks on your system (e.g outdated glibc) will not become an issue.
  • Building from source: Building from source is as simple as passing a flag to Docker. You do not have to install any dependencies on your system.

Demo

demo