<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Red on Medium]]></title>
        <description><![CDATA[Stories by Red on Medium]]></description>
        <link>https://medium.com/@cold_sats?source=rss-db30f98c8efe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bq2qjrAXi19uzhKB5urIhg.jpeg</url>
            <title>Stories by Red on Medium</title>
            <link>https://medium.com/@cold_sats?source=rss-db30f98c8efe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:40:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cold_sats/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Bootstrap a Profitable Lightning Node]]></title>
            <link>https://medium.com/@cold_sats/how-to-bootstrap-a-profitable-lightning-node-8de72beac59c?source=rss-db30f98c8efe------2</link>
            <guid isPermaLink="false">https://medium.com/p/8de72beac59c</guid>
            <dc:creator><![CDATA[Red]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 15:52:02 GMT</pubDate>
            <atom:updated>2022-08-11T05:33:46.724Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learnings from a top 100 node to help illuminate your path</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*0U_46HqT0aJuflOR" /></figure><p>The most profitable Lightning nodes have a unique edge. Natural demand as a <a href="https://www.bitrefill.com/">merchant</a>, <a href="https://breez.technology/">mobile wallet</a>, <a href="https://www.bitfinex.com/">exchange</a>, <a href="https://lnbig.com/#/">liquidity provider</a>. Large stack and girthy channels, liquidity relationships, savvy scripts, history, knowledge.</p><p>What is a <a href="https://t.me/plebnet">pleb</a> to do in this world?</p><p>Lightning is a moving target and I can’t show you your path. I’ll share my approach over the last few months of running my node <a href="https://amboss.space/c/coldsats">Cold Sats</a> to help illuminate it, but you must find your own way.</p><p>Cold Sats will yield 1.44% this year if I keep up with my <a href="https://twitter.com/cold_sats/status/1488892842739003393?s=20&amp;t=vsDeXO5j7YoXiJjVqrsNbg">current pace</a>. If you’re disappointed then turn back now. Lightning is a low risk, low reward place to make your sats more liquid.</p><p>I don’t know how you found your way here but you’ve joined us at the beginning of a revolution. Take a front row seat with me.</p><h4>Build Your Node</h4><p>The most common way to run a node is on a <a href="https://www.raspberrypi.com/products/raspberry-pi-4-model-b/">Raspberry Pi</a> 4 8GB. If you’re new to Lightning I suggest running <a href="https://mynodebtc.com/">myNode</a>, <a href="https://getumbrel.com/">Umbrel</a> or <a href="https://github.com/rootzoll/raspiblitz">Raspiblitz</a> on a pi.</p><p>I chose myNode which came loaded with <a href="https://github.com/bitcoin/bitcoin">Bitcoin</a>, <a href="https://github.com/lightningnetwork/lnd">LND</a>, <a href="https://www.torproject.org/">Tor</a>, <a href="https://github.com/Ride-The-Lightning/RTL">RTL</a>, <a href="https://thunderhub.io/">Thunderhub</a>, <a href="https://mempool.space/">Mempool</a> and more apps that I never tried. I use RTL as my core GUI.</p><p>Flash a file onto a micro SD, plug that into a pi that’s plugged into a 1 TB+ SSD, turn on the machine and you’re syncing. Access the node by going to the machine’s IP address in a browser. From there you can do most management things in a web GUI, but some advanced tools require command line.</p><p>Guides from <a href="https://armantheparman.com/mynode-bitcoin-node-easy-setup-guide-raspberry-pi/">@parman_the</a> and <a href="https://www.youtube.com/watch?v=GMovZg_3ERs&amp;t=806s">@BTCsessions</a> describe this process well.</p><p>I had <a href="https://twitter.com/cold_sats/status/1484191813376167941?s=20&amp;t=AOg9pcX8OvzTWDbm2WcmTg">issues</a> with my 4GB pi running 85 channels over tor. Machine would freeze or all channels go offline. Reboots sometimes helped. Usually it resolved itself after some time. I estimate 90% uptime.</p><p>I <a href="https://twitter.com/cold_sats/status/1495126848631496704?s=20&amp;t=DB2n_f3PNIERegh3RbXptQ">migrated</a> to a more powerful machine running a <a href="https://raspibolt.org/bitcoin-core.html">RaspiBolt</a> setup and switched to <a href="https://lightningnetwork.plus/posts/137">hybrid mode</a> recently and I’ve had 100% uptime since.</p><p>I still recommend a pi to start. It’s the easiest plug and play solution and with 8GB ram you likely won’t have the same issues as me.</p><h4>Secure Your Seed + channel.backup</h4><p>After syncing the Bitcoin blockchain you’re ready to create a Lightning wallet. I use <a href="https://github.com/lightningnetwork/lnd">LND</a> which is the most popular implementation of Lightning, but consider looking into <a href="https://github.com/ElementsProject/lightning">c-lightning</a> or <a href="https://github.com/ACINQ/eclair">Eclair</a>.</p><p>Note that LND uses an <a href="https://docs.lightning.engineering/lightning-network-tools/lnd/safety#aezeed">aezeed seed</a> which is different than BIP39. You must use a wallet that supports aezeed like <a href="https://bluewallet.io/">BlueWallet</a> to access your funds.</p><p>If your node blows up then you will need to <a href="https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md">recover your funds</a> from your channel.backup + seed with either another synced machine or something like <a href="https://blixtwallet.github.io/">Blixt</a>. This process will force close all channels.</p><p>The most popular way to remotely backup your channel.backup file is with the <a href="https://medium.com/r?url=https%3A%2F%2Fgithub.com%2Falexbosworth%2Fbalanceofsatoshis">Balance of Satoshis (BOS)</a> Telegram bot.</p><h4>Consider the Responsibility</h4><p>You must stay online after you open your first channel. If you go offline for an extended period, ensure that you have a <a href="https://github.com/lightningnetwork/lnd/blob/master/docs/watchtower.md">watchtower</a> set up to protect you. Notify channel partners of any ongoing issues.</p><p>Ensure that you understand <a href="https://wiki.ion.radar.tech/tech/channels/channel-closing">cooperative vs. force closures</a>. Sometimes your sats will be stuck in limbo for 2 weeks at a time.</p><p>You’re running a hot wallet, so it’s best to follow good <a href="https://plebnet.wiki/wiki/Node_Hardening">security practices</a>.</p><blockquote>Security is your paranoia vs their will. If their will is greater than your paranoia, they’ll eventually win. — @BitcoinRevolution4 on Plebnet</blockquote><p>If you use onion URLs then that string of text and your password could get keylogged. I use <a href="https://twitter.com/cold_sats/status/1495126866381795332?s=20&amp;t=Pi2VVguvMsJtrhENkNmdWA">hardware SSH keys</a> and disabled password access. Each new third party app installed is a new attack vector. It’s best to keep it simple and run the bare minimum when possible.</p><p>Consider the privacy implications of doxxing any UTXOs you own, exposing your IP, or connecting your Twitter / Telegram to your Lightning node. You don’t need to run a public routing node to use Lightning for your own payments.</p><h4>Survey the Landscape</h4><p>We’re almost ready to melt down your digital gold and shape it into some new pipes, but there are <a href="https://1ml.com/statistics">35K+</a> Lightning nodes. Where to begin?</p><p>I spent most of my early days on <a href="https://amboss.space/">Amboss</a> and <a href="https://terminal.lightning.engineering/#/">Terminal Web</a>. Browse the top 100 nodes and their connections. Then small ones. Consider:</p><ul><li>Outbound fees</li><li>Inbound fees</li><li>Channel partners</li><li>Number of channels</li><li>Size of channels</li></ul><p>You can assume that a node is an outbound sink (never routes inbound) if all inbound fees to it are high. If a node has a static very high outbound fee that suggests they might be a good rebalancer (or a bad partner). Nodes with low or zero outbound fees are often great partners, but sometimes inbound sinks.</p><p>The vast majority of my earnings come from these popular outbound sinks: <a href="https://amboss.space/node/021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d">LOOP</a>, <a href="https://amboss.space/node/033d8656219478701227199cbd6f670335c8d408a92ae88b962c49d4dc0e83e025">bfx-lnd0</a>, <a href="https://amboss.space/node/03cde60a6323f7122d5178255766e38114b4722ede08f7c9e0c5df9b912cc201d6">bfx-lnd1</a>, <a href="https://amboss.space/node/037659a0ac8eb3b8d0a720114efc861d3a940382dcfa1403746b4f8f6b2e8810ba">Nicehash</a> and <a href="https://amboss.space/node/03aa49c1e98ff4f216d886c09da9961c516aca22812c108af1b187896ded89807e">SeasickDiver</a>. This shouldn’t be too much of a secret if you look at my channels and outbound fees.</p><p>My node is built around serving these channels. Fee structure, girth, rebalancing and swapping out. I want these channels to always have outbound liquidity and I want channels that route inbound to them well.</p><h4>Make a List of Nodes and Channel Sizes</h4><p>Make a list of nodes you like. It won’t be obvious and it doesn’t need to be perfect. Consider connecting popular nodes that aren’t connected. Find a few low fee nodes, high fee, outbound sinks, or choose one specific niche.</p><p>Take a look at channel recommenders and other helpful tools offered by <a href="https://github.com/cryptosharks131/lndg">LNDg</a>, <a href="https://lnnodeinsight.com/">LNnodeinsite</a>, <a href="https://lnrouter.app/">LnRouter</a> and <a href="https://gridflare.xyz/explore/node/020a3dce2dab038955eb435a8342e4fe897304015314485d3738d5f41eccb47859">Gridflare</a>.</p><p>Consider roughly how many sats you can allocate to Lightning. You aren’t going to get very far with less than 20 - 30M sats. Take that number and figure out how many channels you can support.</p><p>Don’t make channels smaller than 2M sats. I like girthy channels between 5M - 25M. Large outbound drains 50M - 100M. That means I made less channels, but I believe it has positioned me uniquely. There is no rule.</p><p>I base my channel size on the activity + channel sizes of the node I’m partnering with. If the node has all 5M channels then there’s no point in 20M. If a node routes a lot of large payments I want a bigger channel to support that. I’ve updated many channel sizes over time.</p><p>If I had to choose one channel size it would be 5M sats.</p><h4>Open a Lot of Channels</h4><p>My basic bootstrap approach was to open a <a href="https://twitter.com/cold_sats/status/1455251927717998596?s=20&amp;t=yspPbf9d6jHwGpxuP3kbnw">lot of channels</a> at once, then purchase and rebalance <a href="https://lnbig.com/#/">LNBig</a> inbound into them. It slowly grew organically from there.</p><p>Open a batch of channels with BOS:<br>bos open &lt;pubkey&gt; — amount &lt;amount&gt; &lt;pubkey&gt; — amount &lt;amount&gt;, etc.</p><p>Once you have a few channels opened, use <a href="https://lnnodeinsight.com/?/020a3dce2dab038955eb435a8342e4fe897304015314485d3738d5f41eccb47859">LNnodeinsight</a> to run channel opening simulations to see channel overlaps and score improvements for potential new partners.</p><h4>Set Fees</h4><p>You can use fees to earn sats and steer routing. Increase your fee to decrease the outbound flow of sats and vice versa. The goal is not always a balanced channel but rather to get sats into the spots they are most demanded.</p><p>I run my node with part dynamic fees and part static fees. I categorize my channels into 3 buckets:</p><ul><li><em>Good Outbound</em> — manually updated based on flow<br>704 - 1904ppm</li><li><em>Ok Outbound</em> — updated hourly based on balance<br>0 - 10% outbound (444ppm)<br>11 - 100% outbound (284ppm)</li><li><em>Routers</em> — updated hourly based on balance<br>0 - 10% outbound (444ppm)<br>11 - 25% outbound (284ppm)<br>26 - 75% outbound (84ppm)<br>76 - 100% outbound (4ppm)</li></ul><p>Consider a 4th bucket for permanently low fees if a channel never routes outbound with higher fees but routes inbound very well. I did this with nodes like <a href="https://amboss.space/node/031015a7839468a3c266d662d5bb21ea4cea24226936e2864a7ca4f2c3939836e0">Breeze</a>, <a href="https://amboss.space/node/0242a4ae0c5bef18048fbecf995094b74bfb0f7391418d71ed394784373f41e4f3">Coingate</a>, <a href="https://amboss.space/node/029c5fd64570f2d40dfc2f683865c81e93269dc032416142de5e2e2461359ae34d">PrestonPysh</a>, and <a href="https://amboss.space/node/026165850492521f4ac8abd9bd8088123446d126f648ca35e60f88177dc149ceb2">Boltz</a> at first but moved away from it as outbound demand grew.</p><p>Some nodes run all high static fees. This model requires more rebalancing.</p><p>I generally only want <em>Good Outbound </em>and<em> Routers </em>because I can’t rebalance <em>Ok Outbound</em> profitably. If they don’t route inbound at some point they get cut.</p><p>In retrospect I should have set fees higher at first. I suggest you do that. If you think a channel might drain then look at the inbound fees for that node and match the highest. Then slowly lower every couple days you don’t route.</p><p>I use <a href="https://github.com/accumulator/charge-lnd">charge-lnd</a> on an <a href="https://mynode.community/viewtopic.php?f=5&amp;t=8">hourly cron</a> to set fees automatically. This tool allows me to set up rules for certain channels or liquidity thresholds.</p><p>Update your config with:<br>nano /home/bitcoin/charge-lnd/charge.config</p><p>Do a dry run for fee changes:<br>/home/bitcoin/.local/bin/charge-lnd -c /home/bitcoin/charge-lnd/charge.config — dry-run</p><p>Run fee changes:<br>/home/bitcoin/.local/bin/charge-lnd -c /home/bitcoin/charge-lnd/charge.config</p><p>There is quite a bit of <a href="https://twitter.com/cold_sats/status/1470458179892826114">controlled chaos</a> happening at Cold Sats. With low fees some channels will route outbound that wouldn’t otherwise, creating inbound that is difficult or less likely to get. Then that turns into 10M route to LOOP.</p><p>Low fees also allow my channel partners to rebalance easier if they wish.</p><p>I like to aggressively hold at least a little liquidity on both sides of most channels to avoid route failures due to lack of liquidity. 4ppm and 444ppm help do that.</p><p>Don’t <a href="https://twitter.com/cold_sats/status/1478590176490233858?s=20&amp;t=AOg9pcX8OvzTWDbm2WcmTg">open to LOOP at 4ppm</a> and drain 700K sats in a minute, but do tell me about whatever funny mistake you make.</p><h4>Get Inbound Liquidity</h4><p>Next comes the tricky part. How do you get others to open channels to you?</p><p>Consider using <a href="https://lightningnetwork.plus/">Lightning Network Plus</a> to do swaps for free <a href="https://twitter.com/cold_sats/status/1465375940574208001">inbound liquidity</a>. I personally didn’t do any of these because I wanted to be more targeted and less committed. I would have done a few in retrospect.</p><p>Once you’re more established, other operators will be willing to do dual-funded channels with you using BOS. I’ve opened 24 dual-funded channels to date.</p><p>Many liquidity providers like <a href="https://twitter.com/zerofeerouting">zero fee routing</a> or <a href="https://lnbig.com/#/">LNBig</a> also sell inbound. I purchased 264M sats from LNbig at a cost of 545K sats in my first 2 months. You can also swap out with a protocol like <a href="https://lightning.engineering/loop/">LOOP</a> or mobile wallet like <a href="https://www.walletofsatoshi.com/">Wallet of Satosh</a>i (WOS), which will push your sats remote and get you inbound.</p><p>WOS likely would have been cheaper than my LNBig approach at my scale.</p><p>Make node friends. Run a good node and others will start opening channels to you. Once you get your flow going, inbound liquidity won’t be a concern.</p><h4>Collect Data and Reevaluate</h4><p>There’s a chicken and egg problem when you first start. In order to get good data you need to have a system with inbound liquidity in most channels. That’s why I opted to open a lot of channels at once and rebalance LNBig inbound into them.</p><p>I burned sats in the beginning to collect data. I spent 177K on rebalance (+ on chain fees) and earned 79K in routing fees in my first full month. By the second month I was profitable with 157K earned and 117K spent. Things got a <a href="https://twitter.com/cold_sats/status/1488892842739003393">lot more interesting</a> in the third month.</p><p>You will need 2 – 4 weeks of data. Watch the flow of all of your channels. Ensure that each channel gets some inbound to see how it routes. Sometimes a channel will awaken after a long slumber. If not, close it. I’ve closed 145 channels to date.</p><p>Historically I have only cut channels that I opened. That way it’s no loss to the other operator. I like to maintain good relationships, but if there is truly no movement then neither operator should be upset about a cordial separation.</p><p>You will continue to reevaluate through the whole life of the node, but once you have a solid node it’s not a lot of work. At some point you will see consistent patterns emerge and are ready to start rebalancing where profitable.</p><h4>Rebalance</h4><p>Rebalancing means sending sats to yourself. Increase inbound in one channel and outbound in another. Depending on your fee structure and what you’ve observed, you might rebalance anywhere from none to all of your channels.</p><p>I rebalance only my <em>Good Outbound</em> channels at a rate of 50 - 325ppm depending on current flow. You need high fees to offset that cost. You also need to consider the opportunity cost in moving the sats.</p><p>I use <a href="https://github.com/C-Otto/rebalance-lnd">rebalance-lnd</a> which is a command line tool. BOS (command line) and LNDg (web GUI) are also popular rebalance tools.</p><p>I only set the to channel and rebalance-lnd will automatically attempt to send sats from channels that have a minimum balance of 3M sats. I used to run a large exclude list because I didn’t want to pull sats from bad inbound channels. Over time inbound improved and it shrank. Then I stopped entirely.</p><p>I loop a script in a screen for each channel.</p><p>Create a screen with:<br>screen -S wallet</p><p>Rebalance with:<br>for ((i=0;i&lt;5000;i++)); do timeout 600 rebalance-lnd/rebalance.py -a 400000 — to 797247085257949185 — fee-ppm-limit 200 — min-local 3000000; sleep 60; done</p><p>Then exit the screen with:<br>ctrl+a<br>d</p><p>Re-enter screen with:<br>screen -r wallet</p><p>Kill a screen with:<br>screen -X -S kill wallet</p><p>I kill the script every 10 minutes because it will sometimes hang up on a path for a long time. The downside of running scripts like this is that it can cause more stuck HTLCs which <a href="https://twitter.com/cold_sats/status/1497328037838217217?s=20&amp;t=vsDeXO5j7YoXiJjVqrsNbg">can be an issue in force closures</a>. Rebalance attempts also add to the size of your channel.db.</p><p>Typically I have 2 - 5 scripts running lately, one for each channel. I’ll adjust params or turn them off sometimes if my pace is too fast. It’s quite a manual targeted approach.</p><p>I don’t spend a lot of time on it now but it’s a semi-weekly dance.</p><h4>Swap Out</h4><p>I swap sats out of Lightning so that I can open new channels to <em>Good Outbound</em> nodes after they have drained. This is only economical at certain scales and for channels that command very high fees.</p><p>I have a large channel with WOS that I can rebalance at 50 - 200ppm. It’s relatively easy and reliable to rebalance. I turn this dial up and down given my current pace of outbound vs rebalance vs swap out flow.</p><p>When I’m ready to swap out I send sats from WOS channel to WOS wallet, then pay 7 - 8K (varies with mempool depth) to send back to myself on chain.</p><p>The round trip costs me up to 360ppm for 50M sats or 280ppm for 100M.</p><h4>Maintain Your Node</h4><p>The more activity in your node (rebalances + routes) the larger your channel.db will grow. You will need to regularly <a href="https://plebnet.wiki/wiki/Compacting_Channel_DB">compact the channel.db</a> to decrease the size. Currently LND can only do this during a restart. Mine is 11GB right now.</p><p>Check the size of your channel.db with (path depending on machine):<br>sudo du -ha /data/lnd/data/graph/mainnet/channel.db</p><p>Once a channel reaches over 100–200K updates consider closing and re-opening it. This will clear the data stored for that channel. Wait until more sats are on your side because on chain sats and inbound liquidity are valuable.</p><p>Check your largest channels with:<br>lncli listchannels | jq -r ‘.[][]| [.num_updates, .remote_pubkey] | @tsv’ | sort -rn</p><p>There are dozens of other helpful commands for <a href="https://github.com/tomosaigon/lncli-commands">LND</a> and <a href="https://github.com/niteshbalusu11/BOS-Commands-Document">BOS</a>.</p><h4>Join the Community</h4><p>There’s a special <a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">social movement</a> happening in Lightning. It pulled me into Twitter after years of lurking. I joined Bitcoin at the end of 2013 and when I look around at Lightning now I get the same vibes. It’s mostly technical, ideal driven, optimistic people.</p><p>I joined <a href="https://t.me/plebnet">Plebnet Telegram</a> about a month into my journey and it opened up a new dimension. I’ve made dozens of node friends and learned so much about Bitcoin, Lightning and Linux. Read the past conversations there and ask questions.</p><h4>Take a Step Back</h4><p>Recognize again that the target will move and Lightning will hopefully be a different, much larger place in the future.</p><p>Lightning is a long term game of patience. Changes to your fees can take days to weeks to make an effect. I didn’t route to my golden goose LOOP for the last 3 days, then 10M this morning.</p><p>When you route a random payment consider where that payment came from. Sure it’s often a rebalance but I’m sure I’ve routed remittances to El Salvador.</p><p>I run a Lightning node not just to earn sats but to help scale Bitcoin. Permisionless sound money is a fundamental human right and never before has there been an opportunity like this to enforce that.</p><p>I got struck by Lightning and I hope you get struck too.</p><p>Cover image: <a href="https://dribbble.com/shots/5479640-Jolt-Inktober-30-31">https://dribbble.com/shots/5479640-Jolt-Inktober-30-31</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8de72beac59c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Migrate LND From myNode or Umbrel to RaspiBolt]]></title>
            <link>https://medium.com/@cold_sats/how-to-migrate-lnd-from-mynode-to-raspibolt-ubuntu-server-e6089a92eae7?source=rss-db30f98c8efe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6089a92eae7</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[lightning]]></category>
            <dc:creator><![CDATA[Red]]></dc:creator>
            <pubDate>Sat, 19 Feb 2022 22:51:36 GMT</pubDate>
            <atom:updated>2022-08-15T01:32:55.046Z</atom:updated>
            <content:encoded><![CDATA[<h4>A step-by-step list of commands to level your node up</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xeO9nYLqIK9rl4PdnkyCZw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7IvRf610KFMchNa9V1lQQ.jpeg" /></figure><p>These are the commands I used to migrate my Bitcoin Lightning node <a href="https://amboss.space/c/coldsats">Cold Sats</a> from a pi4 running <a href="https://mynodebtc.com/">myNode</a> to a new bare metal machine. I’ve included commands for <a href="https://getumbrel.com/">Umbrel</a> as well.</p><p>I <a href="https://twitter.com/cold_sats/status/1495126848631496704">built the new machine</a> and installed Ubuntu Server, then followed the <a href="https://raspibolt.org/">RaspiBolt</a> guide to setup the file structure, users, install Bitcoin / LND, etc. Then I copied the LND directory from the pi4 to the new machine.</p><p>Ensure you have your seed and channel.backup and an understanding of how to recover from them before migrating. Either a second machine already synced and ready or <a href="https://blixtwallet.github.io/">Blixt Wallet</a> are good solutions for recovery.</p><p>NEVER run the same node on two different machines at the same time. Once you start LND on the new node, NEVER start LND on your old node again.</p><h3>High Level Process</h3><h4>Preparation</h4><p>- Follow RaspiBolt guide until LND wallet creation, but don’t create a wallet<br>- Set up a password.txt and new LND config in a temp directory<br>- Backup channel.backup and export channels in RTL (just for reference)</p><h4>Migration</h4><p><em>On old machine:<br>- </em>Stop forwards and wait until there are no pending HTLCs</p><p><em>On both machines:<br>- </em>Stop LND</p><p><em>On new machine:<br>- </em>Move LND directory to a temp directory (or delete it)<br>- Copy LND directory from old machine to new machine</p><p><em>On old machine:<br>- </em>Rename channel.db / LND config then turn machine off</p><p><em>On new machine:<br>- </em>Check / update permissions for LND directory<br>- Remove tls.cert, tls.key, macaroons and macaroons.db<br>- Move password.txt and LND config from temp to LND directory<br>- Start LND to ensure it works, then stop<br>- Finish RaspiBolt step of “Allow user “admin” to work with LND”<br>- Enable the LND service</p><h3>Migration Commands</h3><h4>Old node (logged in as admin)</h4><p>I did not do this, but it would be wise to stop forwards and wait until there are no pending HTLCs. Or at least ensure that none will expire soon.</p><p>Stop forwards:<br>bos limit-forwarding --disable-forwards</p><h4>New node (logged in as admin)</h4><p>Start LND to ensure it works, then stop:<br>lnd<br>ctrl+c</p><p>Ensure LND is stopped in systemd:<br>systemctl status lnd<br>or check logs to see it is stopped:<br>sudo journalctl -f -u lnd</p><p>If not stopped stop with:<br>systemctl disable lnd</p><p>Instead of deleting files I move them to a temp directory just in case I need. Create a temp directory and move current LND directory there:<br>mkdir /temp<br>mv /data/lnd lnd-old<br>mv /data/lnd-old /temp</p><p>Add a password.txt file and LND config file:<br>nano /temp/password.txt<br>nano /temp/lnd.conf<br>Add your LND password and planned LND config to those files.</p><p>LND password can be found in:<br><em>myNode</em>: sudo nano /mnt/hdd/mynode/settings/.lndpw<br><em>Umbrel</em>: your GUI password (or may be default: moneyprintergobrrr)</p><h4>Old node (logged in as admin)</h4><p>Check that LND version is the same as new node (v0.14.2-beta for me).<br>Take snapshot of current channels with RTL (just for reference).<br>Save channel.backup with bos TG bot.</p><p>Open a second SSH session as admin and tail LND logs to ensure it stops:<br><em>myNode</em>: sudo tail -f /home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log<br><em>Umbrel</em>: tail -f ~/umbrel/lnd/logs/bitcoin/mainnet/lnd.log</p><p>Stop LND in first session:<br><em>myNode</em>: sudo mynode-stop-services<br><em>Umbrel</em>: sudo ./umbrel/scripts/stop</p><p>Check LND is stopped in the second SSH session.</p><p>Give admin rights to LND directory so you can copy it from new node:<br><em>myNode</em>: sudo chmod -R 755 /mnt/hdd/mynode/lnd<br><em>Umbrel</em>: sudo chmod -R 755 /mnt/data/umbrel/lnd</p><h4>New node (logged in as admin)</h4><p>Copy LND from old node to new node (insert your old node IP):<br><em>myNode</em>: sudo rsync -rhvP --append-verify admin@&lt;ip&gt;:/mnt/hdd/mynode/lnd /data/lnd<br><em>Umbrel</em>: sudo rsync -rhvP --append-verify umbrel@&lt;ip&gt;:/mnt/data/umbrel/lnd /data/lnd</p><p>Wait for copying to finish.</p><h4>Old node (logged in as admin)</h4><p>Destroy the heart of old node (rename channel.db / lnd.conf):<br><em>myNode</em>: sudo -u bitcoin mv /mnt/hdd/mynode/lnd/data/graph/mainnet/channel.db /mnt/hdd/mynode/lnd/data/graph/mainnet/channel.bak<br>sudo -u bitcoin mv /mnt/hdd/mynode/lnd/lnd.conf /mnt/hdd/mynode/lnd/lnd.bak<br><em>Umbrel</em>: sudo -u bitcoin mv /mnt/data/umbrel/lnd/data/graph/mainnet/channel.db /mnt/data/umbrel/lnd/data/graph/mainnet/channel.bak<br>sudo -u bitcoin mv /mnt/data/umbrel/lnd/lnd.conf /mnt/data/umbrel/lnd/lnd.bak</p><p>Say a final farewell and unplug old node.</p><h4>NEW NODE (logged in as admin)</h4><p>Check that everything is owned by LND (except “..”):<br>ls -la /data/lnd<br>If the directory is owned by root (it was for me), make LND the owner:<br>sudo chown -R lnd:lnd /data/lnd</p><p>Remove TOR v3 certificate:<br>sudo mv /data/lnd/v3_onion_private_key /temp</p><p>Remove myNode config files (only on myNode):<br>sudo mv /data/lnd/lnd.conf /temp<br>sudo mv /data/lnd/lnd.conf.save /temp <br>sudo mv /data/lnd/lnd.conf.save.1 /temp</p><p>Remove tls.cert and tls.key:<br>sudo mv /data/lnd/tls.key /temp<br>sudo mv /data/lnd/tls.cert /temp</p><p>Remove macaroons + macaroons.db:<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/macaroons.db /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/admin.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/chainnotifier.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/charge-lnd.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/invoice.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/invoices.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/readonly.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/router.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/signer.macaroon /temp<br>sudo mv /data/lnd/data/chain/bitcoin/mainnet/walletkit.macaroon /temp</p><p>Move password.txt &amp; lnd.conf from temp to LND directory:<br>sudo mv /temp/lnd.conf /data/lnd &amp;&amp; mv /temp/password.txt /data/lnd</p><p>Log into LND user and give password LND rights:<br>sudo su lnd<br>chmod 600 /data/lnd/password.txt</p><p>Double check everything is correctly removed and LND directory looks good.</p><p>⚡ <strong>MOMENT OF TRUTH</strong> ⚡</p><p>Start LND:<br>lnd</p><p><strong>🚨 NEVER START LND ON OLD NODE AGAIN 🚨</strong></p><p>Monitor that it works. You may see errors like I did (I had wrong password, then an issue in tor config). Read the error and try to figure out the issue. Reach out to node friends on Plebnet, myNode or other TG channels.</p><p>If your wallet unlocks and LND starts up then you have successfully migrated.</p><p>Exit LND:<br>ctrl + c</p><p>Exit LND user session (i.e. go back to admin user):<br>exit</p><p>Remove the temp directory:<br>rm -rf /temp</p><p>Allow admin user to work with LND:<br>ln -s /data/lnd /home/admin/.lnd<br>sudo chmod -R g+X /data/lnd/data/<br>sudo chmod g+r /data/lnd/data/chain/bitcoin/mainnet/admin.macaroon</p><p>Check that lncli works:<br>lncli getinfo</p><p>Start LND in systemd:<br>sudo systemctl enable lnd<br>sudo systemctl start lnd<br>systemctl status lnd</p><p>Congrats! You have leveled up.</p><p><strong>References<br></strong><a href="https://raspibolt.org/faq.html#can-i-update-my-raspibolt-2-to-the-new-version">https://raspibolt.org/faq.html#can-i-update-my-raspibolt-2-to-the-new-versio<br>n</a><a href="https://docs.lightning.engineering/lightning-network-tools/lnd/migrating-lnd">https://docs.lightning.engineering/lightning-network-tools/lnd/migrating-lnd</a><br><a href="https://bitcoincore.org/bin/bitcoin-core-22.0/">https://bitcoincore.org/bin/bitcoin-core-22.0/</a><br><a href="https://github.com/lightningnetwork/lnd/releases">https://github.com/lightningnetwork/lnd/releases</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6089a92eae7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>