Rebalancing Swaps via Terminal (easy)

Posted 7 days ago by SatoshiPrime_io

Rebalance your swaps using an Umbrel Node and a Mac...

open Terminal

Login to your umbrel node:
 ssh umbrel@umbrel.local
hit [ENTER]
enter your umbrel password and hit [ENTER]

cd ~/umbrel/bin     

Go to your swap page and COPY the following code (the XXX will be the amount of the rebalance):     
lncli addinvoice --amt XXXXXX

In Terminal type:
sudo docker exec lnd 
then paste the info from your swaps page.  It should look something like this: 

sudo docker exec lnd lncli addinvoice --amt 250000

and hit [ENTER]

This will create an invoice.  In Terminal you can see the details of this invoice.  We will use those details later.

docker exec -it lnd sh
hit [ENTER]

Now go back to your swap page and copy the large section of code that starts with "lncli buildroute amt....."

In Terminal type:
and paste the large block of code.

Now, scroll up in Terminal and find the invoice info that we created earlier.  Copy the string of characters in the "payment_addr" field.
scroll back down to your block of code that you pasted and replace [PAYMENT_ADDR] with the code you copied from the invoice info.  NOTE: delete the [] and add "" around the pasted sting.

Then copy the [R_HASH] value from the invoice info and paste it in the block of code in the corresponding section.  Again, deleting the [].  This time DO NOT add ""

 It should look like this:

Then hit [ENTER].   That's it!

I will join another swap and I'll try to record rebalancing and post a link to the video here.  


LN+ replied 6 days ago

Thanks for writing this up! Do link the video when ready!

Please sign in to post replies.

Lightning Network Node
Rank: 4 / Mercury Node
Capacity: 2,598,000 SAT
Channels: 5