mirror of
https://github.com/apotdevin/thunderhub.git
synced 2026-08-19 13:17:59 +02:00
* 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> |
||
|---|---|---|
| .. | ||
| alice-thubConfig.yaml | ||
| bob-thubConfig.yaml | ||
| docker-compose.yml | ||
| Dockerfile.dev | ||
| litd-entrypoint.sh | ||
| README.md | ||
Litd + ThunderHub Docker Setup
Two-node local development environment with Bitcoin Core (regtest), two Lightning Terminal (litd) nodes (Alice & Bob), and two ThunderHub instances.
Alice is configured with a public universe (--taproot-assets.universe.public-access=rw), allowing other nodes to sync assets from her.
Quick Start
cd docker/litd
docker compose up --build
Wait for both litd nodes to initialize, then open:
- ThunderHub Alice: http://localhost:3000
- ThunderHub Bob: http://localhost:3001
- Litd Alice UI: https://localhost:8443 (password:
testpassword123!) - Litd Bob UI: https://localhost:8444 (password:
testpassword123!)
Login password for both ThunderHub instances: thunderhub
Services
| Service | Port | Description |
|---|---|---|
| bitcoind | 18443 | Bitcoin Core RPC (regtest) |
| litd-alice | 8443 | Alice's litd UI / gRPC proxy |
| litd-alice | 10009 | Alice's LND gRPC |
| litd-alice | 9735 | Alice's LND P2P |
| litd-bob | 8444 | Bob's litd UI / gRPC proxy |
| litd-bob | 10010 | Bob's LND gRPC |
| litd-bob | 9736 | Bob's LND P2P |
| thunderhub-alice | 3000 | Alice's ThunderHub |
| thunderhub-bob | 3001 | Bob's ThunderHub |
Fund Wallets and Mine Blocks
# Fund Alice (6 blocks)
docker compose exec bitcoind bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword generatetoaddress 6 $(docker compose exec litd-alice lncli --network=regtest newaddress p2wkh | jq -r '.address')
# Fund Bob (6 blocks)
docker compose exec bitcoind bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword generatetoaddress 6 $(docker compose exec litd-bob lncli --network=regtest newaddress p2wkh | jq -r '.address')
Connect Peers and Open Channel
# Get Bob's pubkey and address
BOB_PUBKEY=$(docker compose exec litd-bob lncli --network=regtest getinfo | jq -r '.identity_pubkey')
# Connect Alice to Bob
docker compose exec litd-alice lncli --network=regtest connect ${BOB_PUBKEY}@litd-bob:9735
# Open channel from Alice to Bob (1M sats)
docker compose exec litd-alice lncli --network=regtest openchannel --node_key=${BOB_PUBKEY} --local_amt=1000000
# Mine blocks to confirm
docker compose exec bitcoind bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword generatetoaddress 6 $(docker compose exec litd-alice lncli --network=regtest newaddress p2wkh | jq -r '.address')
Taproot Asset Workflow
# Alice mints an asset
docker compose exec litd-alice tapcli --tlscertpath=/root/.lit/tls.cert --macaroonpath=/root/.lit/regtest/super.macaroon --rpcserver=localhost:8443 assets mint --type normal --name Thunderbux --supply 1000 --new_grouped_asset
# Finalize the mint batch
docker compose exec litd-alice tapcli --tlscertpath=/root/.lit/tls.cert --macaroonpath=/root/.lit/regtest/super.macaroon --rpcserver=localhost:8443 assets mint finalize
# Mine blocks to confirm
docker compose exec bitcoind bitcoin-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword generatetoaddress 6 $(docker compose exec litd-alice lncli --network=regtest newaddress p2wkh | jq -r '.address')
Add Universe Federation (for asset transfers between nodes)
For Bob to receive assets from Alice, both nodes should federate their universes:
# Add Alice's universe to Bob's federation
docker compose exec litd-bob tapcli --tlscertpath=/root/.lit/tls.cert --macaroonpath=/root/.lit/regtest/super.macaroon --rpcserver=localhost:8443 universe federation add --universe_host=litd-alice:8443
# Add Bob's universe to Alice's federation
docker compose exec litd-alice tapcli --tlscertpath=/root/.lit/tls.cert --macaroonpath=/root/.lit/regtest/super.macaroon --rpcserver=localhost:8443 universe federation add --universe_host=litd-bob:8443
Cleanup
docker compose down # stop containers, keep data
rm -rf data/ # remove all persistent data