3⃣
Deploy Client

LN-STX Bridge Client App

There are a few methods to install the client app as documented in the lnstxbridge-client repository readme. Choose your preferred method based on your environment and technical expertise.

Install with Script

Copy and Paste the below command into your umbrel/raspiblitz/mynode and follow the instructions.
1
bash <(curl -s https://cdn.jsdelivr.net/gh/pseudozach/[email protected]/install.sh)
Copied!
This script will collect required environment variables from you and populate the docker-compose.yml before starting the docker lnstxbridge-client and lnstxbridge-dashboard docker containers.

Install with Docker Compose

1
git clone https://github.com/pseudozach/lnstxbridge-client
2
cd lnstxbridge-client/docker-compose/lnstx-client
Copied!
Copy your LND certificate and admin macaroon to lnstx-client folder. Copy your bitcoin cookie file to lnstx-client folder.
1
cp ~/.lnd/tls.cert docker-compose/lnstx-client/lnd-tls.cert
2
cp ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon docker-compose/lnstx-client/admin.macaroon
3
cp ~/.bitcoin/.cookie docker-compose/lnstx-client/.cookie
Copied!
Note that by copying these files into lnstxbridge-client docker container folder you are giving lnstxbridge-client admin access to your Bitcoin & LND node and allow it to generate/pay invoices, send/receive bitcoin on your behalf.
Modify the docker-compose.yml file and populate it with all of the required environment variables.

Configuration

Modify the boltz.conf file as per your requirements and environment.
1
cd lnstxbridge-client/docker-compose/lnstx-client
2
vim boltz.conf
Copied!
Data in this file is mostly personal choice and depend on operator's environment. Feel free to join #developers channel in our discord and ask if anything is unclear.
1
prepayMinerFee=true
2
# aggregatorUrl is the aggregator instance you're registering with.
3
aggregatorUrl="https://api.lnswap.org:9007"
4
# providerUrl needs to be set to your server IP or tor hidden service IP.
5
providerUrl="http://localhost:9008"
6
​
7
# Backend supports sending messages to Discord after successful and failed
8
# Swaps and if the wallet or channel balance is underneath a configurable threshold
9
# 1. create a bot at https://discord.com/developers/applications
10
# 2. add the bot to any private channel in your discord server
11
# 3. give bot sendmessage access and copy/paste token here
12
[notification]
13
token = ""
14
channel = "secret-lnswapbot-channel"
15
prefix = "lns"
16
# Interval in minutes at which the wallet and channel balances should be checked
17
interval = 10
18
# Some Discord commands (like withdraw) require a TOTP token
19
# This is the path to the secret of that TOTP token
20
otpsecretpath = "/home/workspace/.lnstx/otpSecret.dat"
21
​
22
# Backend supports balancing account funds via centralized exchange (currently OKCoin)
23
# Both automated and on-demand balancing is supported
24
[balancer]
25
apiUri = "https://www.okcoin.com"
26
apiKey = ""
27
secretKey = ""
28
passphrase = ""
29
tradePassword = ""
30
minSTX = 10
31
minBTC = 1000000
32
overshootPercentage = 0
33
autoBalance = false
34
​
35
[dashboard]
36
username = "admin"
37
password = "changeme!!!"
38
​
39
[[pairs]]
40
base = "BTC"
41
quote = "STX"
42
fee = 5
43
timeoutDelta = 1_240
44
​
45
# comment out to disable
46
# [[pairs]]
47
# base = "BTC"
48
# quote = "USDA"
49
# fee = 5
50
# timeoutDelta = 1_240
51
​
52
[[currencies]]
53
symbol = "BTC"
54
network = "bitcoinMainnet"
55
minChannelBalance = 1_000_000
56
minSwapAmount = 10_000
57
maxSwapAmount = 4_294_967
58
maxZeroConfAmount = 10_000_000
59
minLocalBalance = 1_000_000
60
minRemoteBalance = 1_000_000
61
minWalletBalance = 10_000_000
62
maxWalletBalance = 300_000
63
​
64
[currencies.chain]
65
host = "127.0.0.1"
66
port = 8_332
67
# cookie = "/root/.lnstx-client/.cookie"
68
rpcuser = "kek"
69
rpcpass = "kek"
70
​
71
[currencies.lnd]
72
host = "127.0.0.1"
73
port = 10_009
74
certpath = "/lnd/tls.cert"
75
macaroonpath = "/lnd/data/chain/bitcoin/mainnet/admin.macaroon"
76
​
77
[stacks]
78
providerEndpoint = "https://stacks-node-api.mainnet.stacks.co"
79
stxSwapAddress = "SP2507VNQZC9VBXM7X7KB4SF4QJDJRSWHG4V39WPY.stxswap_v8"
80
sip10SwapAddress = "SP2507VNQZC9VBXM7X7KB4SF4QJDJRSWHG4V39WPY.sip10swap_v1"
81
​
82
[[stacks.tokens]]
83
symbol = "STX"
84
maxSwapAmount = 1_294_967000
85
minSwapAmount = 10000
86
​
87
[[stacks.tokens]]
88
symbol = "USDA"
89
maxSwapAmount = 1_294_967000
90
minSwapAmount = 10000
91
contractAddress = "SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR.usda-token"
92
decimals = 6
Copied!

Install from Source

1
// ensure you have node-14 installed
2
​
3
// clone the repo, install requirements and compile
4
git clone https://github.com/pseudozach/lnstxbridge-client.git
5
cd lnstxbridge-client && npm i && npm run compile
Copied!
If you're running directly on linux/MacOS your data folder will be ~/.lnstx-client
Copy boltz.conf there and populate it as explained in configuration section above.
1
mkdir -p ~/.lnstx-client
2
cp lnstxbridge-client/boltz.conf ~/.lnstx-client/boltz.conf
3
vim ~/.lnstx-client/boltz.conf
4
​
5
// once ready run it
6
cd lnstxbridge-client
7
npm run start
Copied!
It's suggested to use process managers like pm2 because there can be many reasons your server might crash, restart and you should always try to ensure high uptime for your bridge.
You can also use an online monitoring tool like cronitor or uptime-kuma to receive alerts if your instance goes down.