lightninglabs / lightning-app

An easy-to-use cross-platform Lightning wallet
GNU General Public License v3.0
898 stars 172 forks source link

Stuck in "Syncing to chain" state when running npm run electron-dev #1293

Closed bolatovumar closed 5 years ago

bolatovumar commented 5 years ago

Description

As the title says once the app launches after I run npm run electron-dev the app is stuck in "Syncing to chain" state. Is anything else needed besides running npm run electron-dev to start developing?

I went through all the steps in setup local cluster. Everything worked fine and I shut down BTCD/LND instances once I went through all the steps. Not sure if this is correct.

Steps to reproduce the behavior

  1. Go through the steps in "Developing Locally" section
  2. Run npm run electron-dev step
  3. Notice the app is stuck in "syncing to chain" state once you recover a wallet.

Screenshot and/or logs if applicable

Screen Shot 2019-08-12 at 9 14 17 PM

tching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:09:39.575 [INF] BTCN: Waiting for more block headers, then will start cfheaders sync from height 0...
lnd: 2019-08-12 21:09:46.568 [INF] LNWL: Opened wallet
lnd: 2019-08-12 21:09:46.569 [INF] LTND: Wallet recovery mode enabled with address lookahead of 250 addresses
lnd: 2019-08-12 21:09:46.759 [INF] LTND: Primary chain is set to: bitcoin
lnd: 2019-08-12 21:09:48.109 [INF] LNWL: The wallet has been unlocked without a time limit
lnd: 2019-08-12 21:09:48.110 [INF] LTND: LightningWallet opened
lnd: 2019-08-12 21:09:48.111 [INF] LNWL: RECOVERY MODE ENABLED -- rescanning for used addresses with recovery_window=250
lnd: 2019-08-12 21:09:48.162 [INF] HSWC: Restoring in-memory circuit state from disk
lnd: 2019-08-12 21:09:48.184 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0
lnd: 2019-08-12 21:09:48.184 [INF] BTCN: Registering block subscription: id=2
lnd: 2019-08-12 21:09:48.184 [INF] LNWL: Started rescan from block 683e86bd5c6d110d91b94b97137ba6bfe02dbbdb8e3dff722a669b5d69d77af6 (height 0) for 1 address
lnd: 2019-08-12 21:09:48.187 [INF] BTCN: Canceling block subscription: id=2
lnd: 2019-08-12 21:09:48.188 [INF] LNWL: Catching up block hashes to height 0, this might take a while
lnd: 2019-08-12 21:09:48.191 [INF] BTCN: Registering block subscription: id=3
lnd: 2019-08-12 21:09:48.228 [INF] LNWL: Done catching up block hashes
lnd: 2019-08-12 21:09:48.229 [INF] LNWL: Finished rescan for 1 address (synced to block 683e86bd5c6d110d91b94b97137ba6bfe02dbbdb8e3dff722a669b5d69d77af6, height 0)
lnd: 2019-08-12 21:09:48.288 [INF] LTND: Channel backup proxy channel notifier starting
lnd: 2019-08-12 21:09:48.289 [INF] ATPL: Instantiating autopilot with cfg: (*lnd.autoPilotConfig)(0xc000086940)({
 Active: (bool) false,
 Heuristic: (map[string]float64) (len=2) {
  (string) (len=13) "externalscore": (float64) 0.95,
  (string) (len=12) "preferential": (float64) 0.05
 },
 MaxChannels: (int) 5,
 Allocation: (float64) 1,
 MinChannelSize: (int64) 20000,
 MaxChannelSize: (int64) 16777215,
 Private: (bool) true,
 MinConfs: (int32) 1,
 ConfTarget: (uint32) 6
})
lnd: 2019-08-12 21:09:48.292 [INF] RPCS: RPC server listening on 127.0.0.1:10006
lnd: 2019-08-12 21:09:48.292 [INF] RPCS: gRPC proxy started at 127.0.0.1:8086
lnd: 2019-08-12 21:09:48.293 [INF] PRNF: PeerNotifier starting
2019-08-12 21:09:48.293 [INF] BTCN: Registering block subscription: id=4
lnd: 2019-08-12 21:09:48.323 [INF] HSWC: Starting HTLC Switch
2019-08-12 21:09:48.324 [INF] NTFN: New block epoch subscription
lnd: 2019-08-12 21:09:48.325 [INF] NTFN: New block epoch subscription
lnd: 2019-08-12 21:09:48.326 [INF] NTFN: New block epoch subscription
lnd: 2019-08-12 21:09:48.329 [INF] DISC: Authenticated Gossiper is starting
2019-08-12 21:09:48.330 [INF] NTFN: New block epoch subscription
lnd: 2019-08-12 21:09:48.330 [INF] NTFN: New block epoch subscription
2019-08-12 21:09:48.330 [INF] BRAR: Starting contract observer, watching for breaches.
lnd: 2019-08-12 21:09:48.333 [INF] CRTR: Examining channel graph for zombie channels
2019-08-12 21:09:48.336 [INF] CRTR: Pruning 0 zombie channels
lnd: 2019-08-12 21:09:48.382 [INF] CHBU: Starting chanbackup.SubSwapper
lnd: 2019-08-12 21:09:48.384 [INF] CMGR: Server listening on 127.0.0.1:10016
lnd: 2019-08-12 21:09:48.405 [INF] SRVR: Auto peer bootstrapping is disabled
lnd: 2019-08-12 21:09:48.416 [INF] CHBU: Updating backup file at data/lnd/data/chain/bitcoin/simnet/channel.backup
lnd: 2019-08-12 21:09:48.430 [INF] CHBU: Swapping old multi backup file from data/lnd/data/chain/bitcoin/simnet/temp-dont-use.backup to data/lnd/data/chain/bitcoin/simnet/channel.backup
lnd: 2019-08-12 21:09:51.669 [INF] INVC: New invoice subscription client: id=0
lnd: 2019-08-12 21:11:24.541 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:11:24.541 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:11:24.541 [INF] SYNC: Lost peer 127.0.0.1:51144 (inbound)
btcd: 2019-08-12 21:11:29.569 [INF] SYNC: New valid peer 127.0.0.1:51317 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:11:29.570 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:11:29.570 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:11:29.571 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
btcd: 2019-08-12 21:12:50.443 [INF] SYNC: New valid peer 127.0.0.1:51484 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
btcd: 2019-08-12 21:12:55.252 [INF] SYNC: New valid peer 127.0.0.1:51498 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
btcd: 2019-08-12 21:12:55.256 [INF] SYNC: Lost peer 127.0.0.1:51498 (inbound)
lnd: 2019-08-12 21:12:59.576 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:12:59.577 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:12:59.577 [INF] SYNC: Lost peer 127.0.0.1:51317 (inbound)
btcd: 2019-08-12 21:13:04.600 [INF] SYNC: New valid peer 127.0.0.1:51510 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:13:04.600 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:13:04.601 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:13:04.601 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:14:34.605 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
btcd: 2019-08-12 21:14:34.605 [INF] SYNC: Lost peer 127.0.0.1:51510 (inbound)
lnd: 2019-08-12 21:14:34.605 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:14:39.632 [INF] SYNC: New valid peer 127.0.0.1:51676 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:14:39.633 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:14:39.633 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:14:39.633 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:16:09.638 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
btcd: 2019-08-12 21:16:09.638 [INF] SYNC: Lost peer 127.0.0.1:51676 (inbound)
lnd: 2019-08-12 21:16:09.639 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:16:14.663 [INF] SYNC: New valid peer 127.0.0.1:51835 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:16:14.663 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:16:14.664 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:16:14.664 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:17:59.672 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:17:59.672 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:17:59.672 [INF] SYNC: Lost peer 127.0.0.1:51835 (inbound)
btcd: 2019-08-12 21:18:04.698 [INF] SYNC: New valid peer 127.0.0.1:51996 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:18:04.699 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:18:04.699 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:18:04.699 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:19:34.705 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:19:34.706 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:19:34.706 [INF] SYNC: Lost peer 127.0.0.1:51996 (inbound)
btcd: 2019-08-12 21:19:39.731 [INF] SYNC: New valid peer 127.0.0.1:52122 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:19:39.731 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:19:39.731 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:19:39.732 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:21:09.737 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:21:09.737 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:21:09.738 [INF] SYNC: Lost peer 127.0.0.1:52122 (inbound)
btcd: 2019-08-12 21:21:14.765 [INF] SYNC: New valid peer 127.0.0.1:52247 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:21:14.766 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:21:14.766 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:21:14.766 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:22:44.770 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:22:44.770 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:22:44.770 [INF] SYNC: Lost peer 127.0.0.1:52247 (inbound)
btcd: 2019-08-12 21:22:49.799 [INF] SYNC: New valid peer 127.0.0.1:52400 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:22:49.800 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:22:49.800 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:22:49.800 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
lnd: 2019-08-12 21:24:19.808 [INF] BTCN: Lost peer 127.0.0.1:18555 (outbound)
2019-08-12 21:24:19.808 [WRN] BTCN: No sync peer candidates available
btcd: 2019-08-12 21:24:19.808 [INF] SYNC: Lost peer 127.0.0.1:52400 (inbound)
btcd: 2019-08-12 21:24:24.834 [INF] SYNC: New valid peer 127.0.0.1:52605 (inbound) (/btcwire:0.5.0/neutrino:0.0.4-beta/)
lnd: 2019-08-12 21:24:24.834 [INF] BTCN: New valid peer 127.0.0.1:18555 (outbound) (/btcwire:0.5.0/btcd:0.12.0/)
2019-08-12 21:24:24.835 [INF] BTCN: Syncing to block height 0 from peer 127.0.0.1:18555
2019-08-12 21:24:24.835 [INF] BTCN: Fetching set of headers from tip (height=0) from peer 127.0.0.1:18555
bolatovumar commented 5 years ago

If you are creating a new wallet rather than recovering an old one you get stuck at an even earlier phase:

Screen Shot 2019-08-12 at 9 40 55 PM

valentinewallace commented 5 years ago

Unfortunately Neutrino changed the way it conveys sync information in the getInfo lnd RPC call, so we can't track sync progress the way we used to. Haven't quite come up with a replacement solution yet.

bolatovumar commented 5 years ago

@valentinewallace what does the dev process look like in this case then? Does everyone who attempt to do dev through npm run electron-dev run into this issue?

valentinewallace commented 5 years ago

Oh, I think I misunderstood. If this is on simnet, you need to mine blocks yourself. It won't display as fully synced unless the total block height to sync is greater than 0.

bolatovumar commented 5 years ago

Alright, I mined some blocks after running npm run electron-dev and it synced. I had mined some blocks previously and thought that would be enough but I guess not.