3️⃣Deploy Backend
Backend App
LN-STX Bridge has very few requirements and can be installed by running below commands as detailed in the github repository readme.
// ensure you have node-14 installed
// clone the repo, install requirements and compile
git clone https://github.com/pseudozach/lnstxbridge.git
cd lnstxbridge && npm i && npm run compileNote that in order to start the app and serve swaps, there are still many requirements like opening Lightning channels from your node and funding the swap provider signer account with STX and BTC funds.
Contracts
Each bridge instance should run its own swap contracts for both transparency purposes and to make it easy for the bridge backend to track the swaps.
Easiest way to deploy the swap contracts is to launch explorer sandbox, copy/paste contents of the latest version of the contracts and click deploy!
Signer Account
As a swap provider, lnstxbridge will need access to private keys for a stacks account that has STX (and any other SIP10 you plan to serve).
Generate a new stacks account using any available method (hiro wallet or stx cli) send STX funds into this account and place the mnemonic seed of this account on the server at ~/.lnstx/seed.dat
Configuration
Once the app is ready and contracts are deployed, it's time to build the configuration file that feeds this data to the app.
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.
Ready to Launch!
Now that you've prepared all the requirements you can deploy your backend!
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.
Last updated