thunderhub/docker/litd/docker-compose.yml
Bufo 72431bd1e2
feat: add trading offers section for taproot assets (#667)
* feat: add trading offers section for taproot assets

Query liquidity offers from an external API showing lightning nodes
that provide exchange between taproot assets and bitcoin. Each node
advertises their own exchange rate.

- Add TRADE_API_URL env var for configurable API endpoint
- Server proxies external GraphQL API via FetchService (same pattern as Amboss)
- Trading tab with asset selector, buy/sell toggle, sortable offers list
- Each offer shows node alias/pubkey, exchange rate, available amount

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: improve trading offers with auth, filtering, and API updates

- Update supported assets query path (public.assets.supported)
- Add Amboss auth to trade API calls via context
- Add configurable AMBOSS_AUTH_URL env var
- Wire up min amount filter with debounced input
- Format available capacity with thousand separators
- Add Amboss login banner for unauthenticated users
- Use host.docker.internal for Docker trade/auth URLs
- Remove unused assetIdToGroupKey map

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: add small copy

* feat: add node capabilities query and disable tapd nav when unavailable

Add getNodeCapabilities GraphQL query that exposes provider capabilities.
Use it in the sidebar to gray out Assets and Trading nav items when
taproot_assets is not available, with a tooltip explaining how to enable it.
Also show a message when user has no supported assets to sell.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: lnd capabilities

* feat: hide Assets nav when tapd unavailable, keep Trading disabled

Assets is removed from sidebar when taproot_assets capability is missing.
Trading remains visible but grayed out with an explanatory tooltip.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: address comments

* fix: copy

* chore: address comments

* chore: nullable + security changes

---------

Co-authored-by: Bufo <bufo24@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:53:42 +00:00

244 lines
7.5 KiB
YAML

services:
bitcoind:
image: lightninglabs/bitcoin-core:29
restart: unless-stopped
command:
- -regtest
- -server
- -rpcuser=rpcuser
- -rpcpassword=rpcpassword
- -rpcallowip=0.0.0.0/0
- -rpcbind=0.0.0.0
- -zmqpubrawblock=tcp://0.0.0.0:28332
- -zmqpubrawtx=tcp://0.0.0.0:28333
- -fallbackfee=0.00001
- -txindex=1
ports:
- "18443:18443"
volumes:
- ./data/bitcoind:/home/bitcoin/.bitcoin
networks:
- litd-net
healthcheck:
test:
[
"CMD",
"bitcoin-cli",
"-regtest",
"-rpcuser=rpcuser",
"-rpcpassword=rpcpassword",
"getblockcount",
]
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
bitcoind-init:
image: lightninglabs/bitcoin-core:29
depends_on:
bitcoind:
condition: service_healthy
restart: "no"
entrypoint: ["/bin/sh", "-c"]
command:
- |
HEIGHT=$$(bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword -rpcconnect=bitcoind getblockcount 2>/dev/null || echo 0)
if [ "$$HEIGHT" -lt 1 ]; then
echo "Mining 6 initial blocks..."
bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword -rpcconnect=bitcoind createwallet miner >/dev/null 2>&1 || true
ADDR=$$(bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword -rpcconnect=bitcoind -rpcwallet=miner getnewaddress)
bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword -rpcconnect=bitcoind generatetoaddress 6 "$$ADDR" >/dev/null
echo "Initial blocks mined"
else
echo "Chain has $$HEIGHT blocks, skipping"
fi
networks:
- litd-net
litd-alice:
image: lightninglabs/lightning-terminal:v0.16.1-alpha
restart: unless-stopped
depends_on:
bitcoind-init:
condition: service_completed_successfully
environment:
- BITCOIN_RPC_HOST=bitcoind
entrypoint: ["/scripts/litd-entrypoint.sh"]
command:
- --httpslisten=0.0.0.0:8443
- --tlsextradomain=litd-alice
- --tlsextraip=0.0.0.0
- --uipassword=testpassword123!
- --lnd-mode=integrated
- --network=regtest
- --lnd.bitcoin.regtest
- --lnd.bitcoin.node=bitcoind
- --lnd.bitcoind.rpchost=bitcoind:18443
- --lnd.bitcoind.rpcuser=rpcuser
- --lnd.bitcoind.rpcpass=rpcpassword
- --lnd.bitcoind.zmqpubrawblock=tcp://bitcoind:28332
- --lnd.bitcoind.zmqpubrawtx=tcp://bitcoind:28333
- --lnd.rpclisten=0.0.0.0:10009
- --lnd.restlisten=0.0.0.0:8080
- --lnd.listen=0.0.0.0:9735
- --lnd.noseedbackup
- --lnd.alias=alice
- --lnd.debuglevel=info
- --lnd.tlsextradomain=litd-alice
- --lnd.tlsextraip=0.0.0.0
- --lnd.protocol.option-scid-alias
- --lnd.protocol.zero-conf
- --lnd.protocol.simple-taproot-chans
- --lnd.protocol.simple-taproot-overlay-chans
- --lnd.protocol.custom-message=17
- --lnd.accept-keysend
- --autopilot.disable
- --taproot-assets.universe.public-access=rw
- --taproot-assets.proofcourieraddr=universerpc://litd-alice:8443
- --taproot-assets.universerpccourier.skipinitdelay
- --taproot-assets.rpclisten=0.0.0.0:10029
- --taproot-assets.allow-public-uni-proof-courier
- --taproot-assets.universe.sync-all-assets
- --taproot-assets.allow-public-stats
ports:
- "8443:8443"
- "10009:10009"
- "9735:9735"
volumes:
- ./data/alice-litd:/root/.lit
- ./data/alice-lnd:/root/.lnd
- ./litd-entrypoint.sh:/scripts/litd-entrypoint.sh:ro
networks:
- litd-net
healthcheck:
test:
[
"CMD-SHELL",
"lncli --network=regtest getinfo && test -f /root/.lit/regtest/super.macaroon",
]
interval: 5s
timeout: 5s
retries: 30
start_period: 120s
litd-bob:
image: lightninglabs/lightning-terminal:v0.16.1-alpha
restart: unless-stopped
depends_on:
bitcoind-init:
condition: service_completed_successfully
environment:
- BITCOIN_RPC_HOST=bitcoind
entrypoint: ["/scripts/litd-entrypoint.sh"]
command:
- --httpslisten=0.0.0.0:8443
- --tlsextradomain=litd-bob
- --tlsextraip=0.0.0.0
- --uipassword=testpassword123!
- --lnd-mode=integrated
- --network=regtest
- --lnd.bitcoin.regtest
- --lnd.bitcoin.node=bitcoind
- --lnd.bitcoind.rpchost=bitcoind:18443
- --lnd.bitcoind.rpcuser=rpcuser
- --lnd.bitcoind.rpcpass=rpcpassword
- --lnd.bitcoind.zmqpubrawblock=tcp://bitcoind:28332
- --lnd.bitcoind.zmqpubrawtx=tcp://bitcoind:28333
- --lnd.rpclisten=0.0.0.0:10009
- --lnd.restlisten=0.0.0.0:8080
- --lnd.listen=0.0.0.0:9735
- --lnd.noseedbackup
- --lnd.alias=bob
- --lnd.debuglevel=info
- --lnd.tlsextradomain=litd-bob
- --lnd.tlsextraip=0.0.0.0
- --lnd.protocol.option-scid-alias
- --lnd.protocol.zero-conf
- --lnd.protocol.simple-taproot-chans
- --lnd.protocol.simple-taproot-overlay-chans
- --lnd.protocol.custom-message=17
- --lnd.accept-keysend
- --autopilot.disable
- --taproot-assets.allow-public-uni-proof-courier
- --taproot-assets.universe.public-access=rw
- --taproot-assets.proofcourieraddr=universerpc://litd-bob:8443
- --taproot-assets.universerpccourier.skipinitdelay
ports:
- "8444:8443"
- "10010:10009"
- "9736:9735"
volumes:
- ./data/bob-litd:/root/.lit
- ./data/bob-lnd:/root/.lnd
- ./litd-entrypoint.sh:/scripts/litd-entrypoint.sh:ro
networks:
- litd-net
healthcheck:
test:
[
"CMD-SHELL",
"lncli --network=regtest getinfo && test -f /root/.lit/regtest/super.macaroon",
]
interval: 5s
timeout: 5s
retries: 30
start_period: 120s
thunderhub-alice:
build:
context: ../..
dockerfile: docker/litd/Dockerfile.dev
restart: unless-stopped
user: root
depends_on:
litd-alice:
condition: service_healthy
environment:
- NODE_ENV=development
- ACCOUNT_CONFIG_PATH=/config/thubConfig.yaml
- LOG_LEVEL=debug
- COOKIE_PATH=/tmp/cookie-alice
- TRADE_API_URL=${TRADE_API_URL:-http://host.docker.internal:3006/graphql}
- AMBOSS_AUTH_URL=${AMBOSS_AUTH_URL:-http://host.docker.internal:3007/graphql}
# host-gateway resolves to the host IP on all platforms (Docker 20.10+)
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3000:3000"
volumes:
- ./alice-thubConfig.yaml:/config/thubConfig.yaml
- ./data/alice-litd:/data/litd:ro
- ./data/alice-lnd:/data/lnd:ro
networks:
- litd-net
thunderhub-bob:
build:
context: ../..
dockerfile: docker/litd/Dockerfile.dev
restart: unless-stopped
user: root
depends_on:
litd-bob:
condition: service_healthy
environment:
- NODE_ENV=development
- ACCOUNT_CONFIG_PATH=/config/thubConfig.yaml
- LOG_LEVEL=debug
- COOKIE_PATH=/tmp/cookie-bob
- TRADE_API_URL=${TRADE_API_URL:-http://host.docker.internal:3006/graphql}
- AMBOSS_AUTH_URL=${AMBOSS_AUTH_URL:-http://host.docker.internal:3007/graphql}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3001:3000"
volumes:
- ./bob-thubConfig.yaml:/config/thubConfig.yaml
- ./data/bob-litd:/data/litd:ro
- ./data/bob-lnd:/data/lnd:ro
networks:
- litd-net
networks:
litd-net: