Closed mayankchhabra closed 4 years ago
Instead of creating a new docker service, perhaps this should be handled by https://github.com/getumbrel/umbrel-manager
lets make it $HOST/lnd/lnd.conf
or /mnt/data/lnd/lnd.conf
can be a docker service for sure and restart: on-error
lets make it $HOST/lnd/lnd.conf or /mnt/data/lnd/lnd.conf
I didn't fully understand that.. can you please elaborate a bit?
Also, since $HOST/lnd/lnd.conf
is symlinked to /mnt/data/lnd/lnd.conf
, the lnd-switch
can make changes directly to $HOST/lnd/lnd.conf
Concept ACK.
Would love to see this, it's a feature that I hear a lot of people talk about but AFAIK no one has implemented yet, would be great if Umbrel was the first.
lets make it $HOST/lnd/lnd.conf or /mnt/data/lnd/lnd.conf
I didn't fully understand that.. can you please elaborate a bit?
Also, since
$HOST/lnd/lnd.conf
is symlinked to/mnt/data/lnd/lnd.conf
, thelnd-switch
can make changes directly to$HOST/lnd/lnd.conf
${HOME}
it would need to keep running too and be able to switch back and forth too.
Say bitcoind is corrupted it should switch back and forth
Will attempt to do this. Probably a bash looping service similar to the unlock script
Awesome! Looking forward. It really is one of the last few missing pieces before we can launch.
going to have a stab at this now.. it will need a lot of testing
sample code which can do it
#!/bin/bash -e
PASSWORD=`cat $PWD/secrets/rpcpass.txt`
INFO=`curl --user lncm:$PASSWORD --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' http://10.254.2.2:18332 2>/dev/null`
HEADERS=`echo $INFO | jq .result.headers`
BLOCKS=`echo $INFO | jq .result.blocks`
if [ $HEADERS -eq $BLOCKS ]; then
echo "Switching over from bitcoind to neutrino"
sed 's/bitcoin.node\=neutrino/bitcoin.node\=bitcoind/g; ' lnd/lnd.conf
fi
Looking good
I know it is an old discussion here, I couldn't find anything new about the subject.
Is it still possible to use 100% LN + Neutrino (or any way to connect to a Bitcoin node on another device)?
I mean, I have a Device (not Umbrel) with a synched BitcoinCoreNode running, I'd like to prepare several Umbrel devices with LN and want to link them to my external BitcoinCoreNode (external just because it is not on the same device, but all on the same Network)
If yes, could someone please share how?
Issue
The user cannot start using his lightning or bitcoin wallet until
bitcoind
has fully synchronized. This adds a lot of friction due to the long delay, creating a very frustrating experience.If
bitcoind
lags behind for some reason, such as when the user had his node turned off for a few days/weeks, the same problem reoccurs.Solution
Neutrino filters can solve this problem. We need an automatic, recurring way to switch lnd's bitcoin mode to
neutrino
frombitcoind
as soon asbitcoind
lags behind by a certain number of blocks from its best header.Ideas
Perhaps it's a good idea to create a new service that runs 24x7 via a container called
lnd-switch
that uses the following environment variables:Considering the above example variables,
lnd-switch
will update the bitcoin node inLND_CONFIG_FILE
frombitcoin.node=bitcoind
tobitcoin.node=neutrino
as soon asbitcoind
'sheaders - blocks >= 144
and update it frombitcoin.node=neutrino
tobitcoin.node=bitcoind
as soon asbitcoind
'sheaders - blocks <= 3
. It also needs a way to restart thelnd
container after every config file change.I'm not sure if this is the right approach or not. If it is, then
lnd-switch
can be a tiny FOSS project on its own that (I think) many more people will find useful.cc @nolim1t @meeDamian