diff --git a/.env.example b/.env.example index 65e07b3..877899b 100644 --- a/.env.example +++ b/.env.example @@ -21,6 +21,10 @@ MONERO_WALLET_RPC_USER= MONERO_WALLET_RPC_PASSWORD= MONERO_WALLET_RPC_WALLET_PASSWORD= MONERO_WALLET_RPC_WALLET_DIR=/wallets + +# Monero daemon +# - Default: uses a third-party daemon (low setup, external dependency) +# - Local: run the bundled `monerod` service and set MONERO_DAEMON_URL=http://monerod:18081 MONERO_DAEMON_URL=http://xmr-node.cakewallet.com:18081 # UI diff --git a/README.md b/README.md index 469632f..5861319 100644 --- a/README.md +++ b/README.md @@ -76,21 +76,35 @@ cp .env.example .env - `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` - `API_KEYS`, `API_KEY_ENCRYPTION_KEY` - `SITE_URL` (public URL for the UI) -- Monero view-only wallet settings (`MONERO_WALLET_RPC_*`) and daemon URL -- `MONERO_DAEMON_URL` if you use your own daemon +- Monero view-only wallet settings (`MONERO_WALLET_RPC_*`) +- `MONERO_DAEMON_URL` (choose one of the options below) -3. Choose a wallet-rpc target and provision view-only wallets: +3. Choose a Monero daemon source: +- **Use a third-party daemon (default):** + - Leave `MONERO_DAEMON_URL` as-is (the default points at a public Monero daemon). +- **Run your own daemon via Docker Compose:** + - Set `MONERO_DAEMON_URL=http://monerod:18081` + - Start the stack with the `local-daemon` profile (see step 5) + - Note: initial sync can take a long time and uses significant disk; payment detection won’t be reliable until the daemon is synced. + +4. Choose a wallet-rpc target and provision view-only wallets: - Use the bundled wallet-rpc containers: - Set `MONERO_WALLET_RPC_URLS=http://wallet-rpc-reconciler-1:18083,http://wallet-rpc-reconciler-2:18083,http://wallet-rpc-reconciler-3:18083` - Or point to an external wallet-rpc service: - Set `MONERO_WALLET_RPC_URLS`, `MONERO_WALLET_RPC_USER`, `MONERO_WALLET_RPC_PASSWORD`, and `MONERO_WALLET_RPC_WALLET_PASSWORD` -4. Start the stack: +5. Start the stack: ``` docker compose up --build -d ``` +If you’re running the bundled `monerod` service: + +``` +docker compose --profile local-daemon up --build -d +``` + ### Optional: donations (disabled by default) Donation endpoints and UI are off by default for self-hosted deployments. diff --git a/docker-compose.yml b/docker-compose.yml index 41ca700..0bcc452 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,6 +64,37 @@ services: db: condition: service_healthy restart: on-failure + monerod: + build: + context: ./docker/monero + args: + MONERO_VERSION: ${MONERO_VERSION:-0.18.4.4} + image: monero-local:${MONERO_VERSION:-0.18.4.4} + entrypoint: ["monerod"] + command: + [ + "--non-interactive", + "--rpc-bind-ip", + "0.0.0.0", + "--rpc-bind-port", + "18081", + "--confirm-external-bind", + "--prune-blockchain", + "--data-dir", + "/data", + "--log-level", + "0" + ] + volumes: + - monerod_data:/data + healthcheck: + test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:18081/get_height >/dev/null || exit 1"] + interval: 30s + timeout: 5s + retries: 10 + start_period: 60s + restart: on-failure + profiles: ["local-daemon"] wallet-rpc-reconciler-1: build: context: ./docker/monero @@ -187,3 +218,4 @@ services: retries: 10 volumes: postgres_data: + monerod_data: