2⃣
Install Nodes

Node Setup

LN-STX Bridge requires 3 nodes to function.
  • Bitcoin full node, unpruned and with tx-index enabled.
  • LND lightning node
  • Stacks blockchain node
In the future it could be possible to run the bridge with a pruned node or by utilizing an external Stacks Node API but currently the most stable method is hosting all required nodes on the same server.

Bitcoin

There are many ways to run a bitcoin node and even other implementations but this bridge uses the default reference implementation.
For security and verification purposes no download links are provided here. Instead it's recommended to visit the official website, preferably github repository and always verify that the software downloaded is the one signed by bitcoin-core maintainers by checking the signatures.
1
// add bitcoin.conf
2
vim ~/.bitcoin/bitcoin.conf
3
testnet=0
4
server=1
5
daemon=1
6
txindex=1
7
zmqpubrawblock=tcp://127.0.0.1:28332
8
zmqpubrawtx=tcp://127.0.0.1:28333
9
rpcbind=127.0.0.1
10
rpcallowip=127.0.0.1/32
11
​
12
// unpack and run bitcoind
13
tar zxvf bitcoin-22.0-x86_64-linux-gnu.tar.gz
14
cd bitcoin-22.0/
15
bitcoind
Copied!

Lightning

LND is one of many lightning implementations. There are plans to swap LND in the future with c-lightning but currently since it provides built-in hold invoice support it is the Lightning Network implementation that is being used in the bridge.
Visit LND github repository releases page and download the latest supported version (as of now, v0.12.0-beta)
1
// add lnd.conf
2
vim ~/.lnd/lnd.conf
3
[Application Options]
4
externalip=xx.xx.xx.xx // public IP of your server
5
listen=localhost:9735
6
alias=<your optional alias>
7
​
8
// only if you have installed tor and want to run your lightning node on tor
9
[tor]
10
tor.active=1
11
tor.v3=1
12
​
13
// unpack and run lnd
14
tar zxvf lnd-linux-amd64-v0.12.0-beta.tar.gz
15
cd lnd-linux-amd64-v0.12.0-beta
16
vim startlnd.sh
17
nohup ./lnd --bitcoin.active --bitcoin.mainnet --accept-keysend \
18
--bitcoin.node=bitcoind &
19
chmod +x startlnd.sh
20
./startlnd.sh
Copied!
Remember to track logs and node status throughout the activity.
For instance you need to manually create or import a seed for LND. You can do so with lncli create or lncli unlock commands.

Stacks

A full stacks node with websocket access is required for the bridge to function. In the future there may be other providers so this requirement is removed but as of now, stacks node is needed.
There's a quite straightforward way to jump-start it as detailed in this repository.
1
// install docker-compose
2
VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
3
DESTINATION=/usr/local/bin/docker-compose
4
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
5
sudo chmod 755 $DESTINATION
6
​
7
// clone stacks-blockchain container
8
git clone https://github.com/stacks-network/stacks-blockchain-docker && cd ./stacks-blockchain-docker
9
​
10
cp sample.env .env
11
​
12
./manage.sh mainnet pull
13
./manage.sh mainnet up
Copied!
Once all nodes are started, it can take some hours until Bitcoin node synchronizes and reaches the chain tip. Stacks node can take multiple days. Be patient and regularly check with the below commands until all nodes are synchronized.
1
bitcoin-cli getblockchaininfo
2
​
3
curl -sL localhost:3999/v2/info | jq .
Copied!