Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@
1. Execute script: `sudo ./setupDocker.sh`
1. Copy script `infrastructure/scripts/setupEnv.sh` to virtual machine `~/setupEnv.sh`
1. Execute script: `./setupEnv.sh`
1. Copy script `infrastructure/scripts/{env}-docker-compose.sh` to virtual machine `~/docker-compose.sh`
1. Copy file `infrastructure/config/docker/{env}-docker-compose.yml` to virtual machine `~/docker-compose.yml`
1. Create docker network `docker network create lightning-network`
1. Copy script `infrastructure/scripts/docker-compose.sh` to virtual machine `~/docker-compose.sh`
1. Copy file `infrastructure/config/docker/{env}-docker-compose-lightning.yml` to virtual machine `~/docker-compose-lightning.yml`
1. Copy file `infrastructure/config/docker/{env}-docker-compose-nginx.yml` to virtual machine `~/docker-compose-nginx.yml`
1. Copy file `infrastructure/config/docker/{env}-docker-compose-boltz.yml` to virtual machine `~/docker-compose-boltz.yml`
1. Execute Docker Compose (see [below](#docker-compose)) after all other setup steps are done:
1. [Bitcoin Node Setup](#bitcoin-node-setup-bitcoind)
1. [Lightning Node Setup](#lightning-node-setup-lnd)
1. [Taproot Setup](#taproot-setup-tapd)
1. [LNbits Setup](#lnbits-setup)
1. [ThunderHub Setup](#thunderhub-setup)
1. [NGINX Setup](#nginx-setup)
1. [Boltz Setup](#boltz-setup)

# Bitcoin Node Setup (bitcoind)

Expand Down Expand Up @@ -59,6 +63,15 @@

1. Copy content of config file `infrastructure/config/nginx/{env}-default.conf` to virtual machine `~/volumes/nginx/default.conf`

# Boltz Setup

1. Copy content of config file `infrastructure/config/boltz/backend/{env}-boltz.conf` to virtual machine `~/volumes/boltz/backend/boltz.conf`
1. `boltz.conf`: Replace
1. `[POSTGRES_DATABASE]` / `[POSTGRES_USERNAME]` / `[POSTGRES_PASSWORD]`
1. `[RPC_USER]` / `[RPC_PASSWORD]`
1. `[WALLET_NAME]`
1. `[PROVIDER_ENDPOINT]`

# Docker Compose

The complete Bitcoin Blockchain data is loaded after the very first startup of the bitcoin node. Therefore it is recommended to copy already available blockchain data to the `~/volumes/bitcoin/...` directory.
Expand Down
12 changes: 5 additions & 7 deletions infrastructure/config/bitcoin/dev-bitcoin.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
testnet=1
server=1
rest=1
txindex=1

rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
rpcport=8332
rpcauth=[RPC-AUTH]

zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333

[test]
wallet=[WALLET]
addresstype=p2sh-segwit

rpcbind=0.0.0.0
rpcport=18332
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
1 change: 1 addition & 0 deletions infrastructure/config/bitcoin/prd-bitcoin.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
server=1
rest=1
txindex=1

rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
Expand Down
150 changes: 150 additions & 0 deletions infrastructure/config/boltz/backend/dev-boltz.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Boltz Backend Configuration - Mainnet
# Integration with existing Lightning.space infrastructure

# Network Configuration - MUST be at top level before any sections!
network = "mainnet"

loglevel = "debug"

[api]
host = "0.0.0.0"
port = 9001
allowedCors = ["*"]

[grpc]
host = "0.0.0.0"
port = 9000

# Sidecar Configuration (Rust component)
[sidecar]
[sidecar.grpc]
host = "0.0.0.0"
port = 9003
certificates = "/root/.boltz/sidecar/certificates"

[sidecar.ws]
host = "0.0.0.0"
port = 9004

[sidecar.api]
host = "0.0.0.0"
port = 9005

# PostgreSQL Database
[postgres]
host = "postgres"
port = 5432
database = "[POSTGRES_DATABASE]"
username = "[POSTGRES_USERNAME]"
password = "[POSTGRES_PASSWORD]"

# Redis Cache (optional but recommended)
[cache]
redisEndpoint = "redis://redis:6379"

# Bitcoin/Lightning Configuration
[[currencies]]
symbol = "BTC"
network = "bitcoinMainnet"

# Wallet balances - adjusted for testing
minWalletBalance = 100_000 # 0.001 BTC (100k sats)
minChannelBalance = 100_000 # 0.001 BTC (100k sats)

# Swap limits
maxSwapAmount = 10_000_000 # 0.1 BTC maximum
minSwapAmount = 2_500 # 2,500 sats minimum (currency level - for all BTC swaps)
maxZeroConfAmount = 0 # Disable 0-conf for security

# Bitcoin Core Configuration
[currencies.chain]
host = "bitcoind"
port = 8332

# RPC Authentication
user = "[RPC_USER]"
password = "[RPC_PASSWORD]"

# ZMQ endpoints for blockchain notifications
zmqpubrawtx = "tcp://bitcoind:28333"
zmqpubrawblock = "tcp://bitcoind:28332"

# Bitcoin wallet name
wallet = "[WALLET_NAME]"

# LND Configuration
[currencies.lnd]
host = "lnd"
port = 10009 # gRPC port (not REST 8080!)

# Credentials - mounted from Docker volumes
certpath = "/root/.lnd/tls.cert"
macaroonpath = "/root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon"

# Swap Pair Configuration: BTC/BTC (Lightning <-> OnChain)
[[pairs]]
base = "BTC"
quote = "BTC"
rate = 1 # 1:1 exchange rate

# Fee configuration (in percent)
fee = 0.5 # 0.5% service fee
swapInFee = 0.25 # 0.25% for submarine swaps (chain -> lightning)

# Swap amount limits (in satoshis)
maxSwapAmount = 10_000_000 # 0.1 BTC
minSwapAmount = 2_500 # 2,500 sats (pair level)

# Submarine Swap specific settings (Chain -> Lightning)
[pairs.submarineSwap]
minSwapAmount = 10_000 # Minimum for submarine swaps (needs high limit due to on-chain fees)

# Reverse Swap specific settings (Lightning -> Chain)
[pairs.reverseSwap]
minSwapAmount = 2_500 # Minimum for reverse swaps (lower fees, no input tx)

# Timeout configuration (in minutes!)
[pairs.timeoutDelta]
chain = 1440 # Chain swap timeout (~24 hours = 144 blocks)
reverse = 1440 # ~24 hours for reverse swaps (lightning -> chain)
swapMinimal = 1440 # Minimum timeout for submarine swaps (~24 hours = 144 blocks)
swapMaximal = 2880 # Maximum timeout (~48 hours = 288 blocks)
swapTaproot = 10080 # 1 week for taproot swaps (10080 blocks)

# Swap Pair Configuration: BTC/RBTC (Lightning BTC <-> RSK RBTC)
[[pairs]]
base = "BTC"
quote = "RBTC"
rate = 1 # 1:1 peg between BTC and RBTC

# Fee configuration (in percent)
fee = 0.25
swapInFee = 0.1

# Swap amount limits (in satoshis)
maxSwapAmount = 10_000_000 # 0.1 BTC/RBTC
minSwapAmount = 2_500 # 2,500 sats minimum (Rootstock has lower fees)

[pairs.timeoutDelta]
chain = 1440 # Chain swap timeout (~24 hours)
reverse = 1440 # Reverse swap timeout (Lightning -> RBTC)
swapMinimal = 1440 # Minimum timeout
swapMaximal = 2880 # Maximum timeout
swapTaproot = 10080

# RSK (Rootstock) Configuration
[rsk]
networkName = "RSK Mainnet"
providerEndpoint = "[PROVIDER_ENDPOINT]"

[[rsk.contracts]]
etherSwap = "0x3d9cc5780CA1db78760ad3D35458509178A85A4A"
erc20Swap = "0x7d5a2187CC8EF75f8822daB0E8C9a2DB147BA045"

[[rsk.tokens]]
symbol = "RBTC"

maxSwapAmount = 10_000_000
minSwapAmount = 2_500

minWalletBalance = 10_000
150 changes: 150 additions & 0 deletions infrastructure/config/boltz/backend/prd-boltz.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Boltz Backend Configuration - Mainnet
# Integration with existing Lightning.space infrastructure

# Network Configuration - MUST be at top level before any sections!
network = "mainnet"

loglevel = "debug"

[api]
host = "0.0.0.0"
port = 9001
allowedCors = ["*"]

[grpc]
host = "0.0.0.0"
port = 9000

# Sidecar Configuration (Rust component)
[sidecar]
[sidecar.grpc]
host = "0.0.0.0"
port = 9003
certificates = "/root/.boltz/sidecar/certificates"

[sidecar.ws]
host = "0.0.0.0"
port = 9004

[sidecar.api]
host = "0.0.0.0"
port = 9005

# PostgreSQL Database
[postgres]
host = "postgres"
port = 5432
database = "[POSTGRES_DATABASE]"
username = "[POSTGRES_USERNAME]"
password = "[POSTGRES_PASSWORD]"

# Redis Cache (optional but recommended)
[cache]
redisEndpoint = "redis://redis:6379"

# Bitcoin/Lightning Configuration
[[currencies]]
symbol = "BTC"
network = "bitcoinMainnet"

# Wallet balances - adjusted for testing
minWalletBalance = 100_000 # 0.001 BTC (100k sats)
minChannelBalance = 100_000 # 0.001 BTC (100k sats)

# Swap limits
maxSwapAmount = 10_000_000 # 0.1 BTC maximum
minSwapAmount = 2_500 # 2,500 sats minimum (currency level - for all BTC swaps)
maxZeroConfAmount = 0 # Disable 0-conf for security

# Bitcoin Core Configuration
[currencies.chain]
host = "bitcoind"
port = 8332

# RPC Authentication
user = "[RPC_USER]"
password = "[RPC_PASSWORD]"

# ZMQ endpoints for blockchain notifications
zmqpubrawtx = "tcp://bitcoind:28333"
zmqpubrawblock = "tcp://bitcoind:28332"

# Bitcoin wallet name
wallet = "[WALLET_NAME]"

# LND Configuration
[currencies.lnd]
host = "lnd"
port = 10009 # gRPC port (not REST 8080!)

# Credentials - mounted from Docker volumes
certpath = "/root/.lnd/tls.cert"
macaroonpath = "/root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon"

# Swap Pair Configuration: BTC/BTC (Lightning <-> OnChain)
[[pairs]]
base = "BTC"
quote = "BTC"
rate = 1 # 1:1 exchange rate

# Fee configuration (in percent)
fee = 0.5 # 0.5% service fee
swapInFee = 0.25 # 0.25% for submarine swaps (chain -> lightning)

# Swap amount limits (in satoshis)
maxSwapAmount = 10_000_000 # 0.1 BTC
minSwapAmount = 2_500 # 2,500 sats (pair level)

# Submarine Swap specific settings (Chain -> Lightning)
[pairs.submarineSwap]
minSwapAmount = 10_000 # Minimum for submarine swaps (needs high limit due to on-chain fees)

# Reverse Swap specific settings (Lightning -> Chain)
[pairs.reverseSwap]
minSwapAmount = 2_500 # Minimum for reverse swaps (lower fees, no input tx)

# Timeout configuration (in minutes!)
[pairs.timeoutDelta]
chain = 1440 # Chain swap timeout (~24 hours = 144 blocks)
reverse = 1440 # ~24 hours for reverse swaps (lightning -> chain)
swapMinimal = 1440 # Minimum timeout for submarine swaps (~24 hours = 144 blocks)
swapMaximal = 2880 # Maximum timeout (~48 hours = 288 blocks)
swapTaproot = 10080 # 1 week for taproot swaps (10080 blocks)

# Swap Pair Configuration: BTC/RBTC (Lightning BTC <-> RSK RBTC)
[[pairs]]
base = "BTC"
quote = "RBTC"
rate = 1 # 1:1 peg between BTC and RBTC

# Fee configuration (in percent)
fee = 0.25
swapInFee = 0.1

# Swap amount limits (in satoshis)
maxSwapAmount = 10_000_000 # 0.1 BTC/RBTC
minSwapAmount = 2_500 # 2,500 sats minimum (Rootstock has lower fees)

[pairs.timeoutDelta]
chain = 1440 # Chain swap timeout (~24 hours)
reverse = 1440 # Reverse swap timeout (Lightning -> RBTC)
swapMinimal = 1440 # Minimum timeout
swapMaximal = 2880 # Maximum timeout
swapTaproot = 10080

# RSK (Rootstock) Configuration
[rsk]
networkName = "RSK Mainnet"
providerEndpoint = "[PROVIDER_ENDPOINT]"

[[rsk.contracts]]
etherSwap = "0x3d9cc5780CA1db78760ad3D35458509178A85A4A"
erc20Swap = "0x7d5a2187CC8EF75f8822daB0E8C9a2DB147BA045"

[[rsk.tokens]]
symbol = "RBTC"

maxSwapAmount = 10_000_000
minSwapAmount = 2_500

minWalletBalance = 10_000
Loading