Created
May 12, 2019 16:13
-
-
Save Sosthene00/cd6f74689b0d630e735b5f1b4b72d93b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Back-up the .lnd dir | |
`cp -r .lnd/ .lnd.old` | |
# copy the .lnd dir to another machine that runs a non-pruned full node | |
`scp [source] [target]` | |
# Install GO | |
`wget https://dl.google.com/go/go1.12.3.linux-amd64.tar.gz` | |
`sha256sum go1.12.3.linux-amd64.tar.gz | awk -F " " '{ print $1 }'` | |
# output should be `3924819eed16e55114f02d25d03e77c916ec40b7fd15c8acb5838b63135b03df` | |
`tar -C /usr/local -xzf go1.12.3.linux-amd64.tar.gz` | |
`export PATH=$PATH:/usr/local/go/bin` | |
# clone the btcwallet repo | |
`git clone https://github.com/btcsuite/btcwallet $GOPATH/src/github.com/btcsuite/btcwallet` | |
# run dropwtxmgr | |
`cd $GOPATH/src/github.com/btcsuite/btcwallet` | |
`GO111MODULE=on go install ./dropwtxmgr` | |
`cd $GOPATH/bin` | |
`dropwtxmgr --db=/path/to/data/chain/bitcoin/mainnet/wallet.db` | |
# Restart lnd, it should run a full rescan from genesis block, that might be a bit long though (24 hours on my machine) |
Haha, yes, it makes you realise that lightning is still hardcore now
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this, being an absolute newbie with Go and linux in general, this gave me a starting point.
In my case, I wanted to recover rescan an lnd instance using an existing mainnet btcpay deployment that I use for testing. Since the docker images used are alpine based, I ran into some trouble with the guide.
For running on alpine, I first ran before your guide:
and instead of
I did:
How long does the drop command take? Mine has been stuck there for a few mins now with no output:
Drop all btcwallet transaction history? [y/N] y
This is a horrible experience, no user should be needing to do this painful technical stuff to fix their lnd.