Closed stefanwouldgo closed 6 years ago
lnd
shuts down when it cannot connect to bitcoind
, that's why lncli
cannot connect to lnd
.
Duplicate of #875.
This still doesn't work on the latest master from github. Any ideas?
make sure your bitcoind
is compiled with ZMQ enabled.
This is the ubuntu ppa from launchpad and it also works with eclair and c-lightning, so I would assume it is ZMQ enabled. Is there any way to be sure, aside from compiling it myself?
Precompiled binaries (like the one from launchpad) probably won't have ZMQ enabled (eclair
and c-lightning
doesn't use it AFAIK), so you will have to compile it yourself or find a binary that have it enabled.
Thanks, but I don't think that was the problem. I have now compiled bitcoind myself with zeromq enabled, and the result is the same:
Attempting automatic RPC configuration to bitcoind
Automatically obtained bitcoind's RPC credentials
2018-05-31 15:46:49.071 [WRN] LTND: open /home/stefan/.lnd/lnd.conf: no such file or directory
2018-05-31 15:46:49.072 [INF] LTND: Version 0.4.2-beta commit=7cf5ebe2650b6798182e10be198c7ffc1f1d6e19
2018-05-31 15:46:49.072 [INF] LTND: Active chain: Bitcoin (network=mainnet)
2018-05-31 15:46:49.077 [INF] CHDB: Checking for schema update: latest_version=0, db_version=0
2018-05-31 15:46:49.104 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
2018-05-31 15:46:49.104 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
2018-05-31 15:46:49.105 [INF] LTND: Waiting for wallet encryption password. Use lncli create
to create wallet, or lncli unlock
to unlock already created wallet.
2018-05-31 15:47:09.295 [INF] LNWL: Opened wallet
2018-05-31 15:47:09.362 [INF] LTND: Primary chain is set to: bitcoin
2018-05-31 15:47:09.363 [INF] LTND: Initializing bitcoind backed fee estimator
2018-05-31 15:47:10.256 [INF] LNWL: Opened wallet
2018-05-31 15:47:10.523 [INF] LNWL: Started listening for blocks via ZMQ on tcp://127.0.0.1:18332
2018-05-31 15:47:11.191 [INF] LNWL: The wallet has been unlocked without a time limit
2018-05-31 15:47:11.191 [INF] LTND: LightningWallet opened
2018-05-31 15:47:11.193 [INF] LNWL: Catching up block hashes to height 525288, this will take a while...
2018-05-31 15:47:11.208 [INF] HSWC: Restoring in-memory circuit state from disk
2018-05-31 15:47:11.209 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0
2018-05-31 15:47:11.211 [INF] LNWL: Caught up to height 0
2018-05-31 15:47:11.225 [INF] RPCS: RPC server listening on 127.0.0.1:10009
2018-05-31 15:47:11.225 [INF] RPCS: gRPC proxy started at 127.0.0.1:8080
2018-05-31 15:47:11.226 [INF] LTND: Waiting for chain backend to finish sync, start_height=525288
2018-05-31 15:47:43.664 [WRN] LNWL: Unable to synchronize wallet to chain: Post http://localhost:8332: EOF
Note that the last line implies something on port 8332, while ZMQ seems to be on port 18332.
This looks a lot like the following problem mentioned in the install instructions:
When running lnd and bitcoind on the same Windows machine, ensure you use 127.0.0.1, not localhost, for all configuration options that require a TCP/IP host address. If you use "localhost" as the host name, you may see extremely slow inter-process-communication between lnd and the bitcoind backend. If lnd is experiencing this issue, you'll see "Waiting for chain backend to finish sync, start_height=XXXXXX" as the last entry in the console or log output, and lnd will appear to hang. Normal lnd output will quickly show multiple messages like this as lnd consumes blocks from bitcoind.
but I don't have localhost mentioned anywhere. just 127.0.0.1 in the bitcoin.conf
The install instructions mention that as users on windows have reported that the localhost resolution is very slow, so we recommend just hard coding the loopback instead.
If it's getting an EOF during the post, then I would check that the bitcoind
is fully synced, and also that you don't have any other active apps using the RPC interface w/o first adjusting the number of rpc threads that bitcoind
is using.
but I don't have localhost mentioned anywhere. just 127.0.0.1 in the bitcoin.conf
By default we use localhost
in the config. In order to override this, you'll need to specify bitcoind.rpchost
in your config.
Still no improvement: [WRN] LNWL: Unable to synchronize wallet to chain: Post http://127.0.0.1:8332: EOF
I have no other apps running that use bitcoind, and I have upped rpcthreads to 8. No change.
I guess it's some idiosyncracy of WSL.
Ensure that you have the proper rpc auth params? If you look at bitcoind
's logs, and even maybe crank up to the debug logging level, do you see any relevant logs?
lnd starts and lncli unlock works, then this happens in lnd:
lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --externalip=... Attempting automatic RPC configuration to bitcoind Automatically obtained bitcoind's RPC credentials 2018-03-19 11:02:55.636 [WRN] LTND: open /home/stefan/.lnd/lnd.conf: no such file or directory 2018-03-19 11:02:55.637 [INF] LTND: Version 0.4.0-beta 2018-03-19 11:02:55.638 [INF] LTND: Active chain: Bitcoin (network=mainnet) 2018-03-19 11:02:55.658 [INF] CHDB: Checking for schema update: latest_version=0, db_version=0 2018-03-19 11:02:55.712 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080 2018-03-19 11:02:55.713 [INF] RPCS: password RPC server listening on 127.0.0.1:10009 2018-03-19 11:02:55.714 [INF] LTND: Waiting for wallet encryption password. Use
lncli create
to create wallet, orlncli unlock
to unlock already created wallet. 2018-03-19 11:03:09.561 [INF] LNWL: Opened wallet 2018-03-19 11:03:09.692 [INF] LTND: Primary chain is set to: bitcoin 2018-03-19 11:03:09.693 [INF] LTND: Initializing bitcoind backed fee estimator 2018-03-19 11:03:11.724 [INF] LNWL: Opened wallet 2018-03-19 11:03:12.222 [INF] LNWL: Started listening for blocks via ZMQ on tcp://127.0.0.1:18332 2018-03-19 11:03:13.550 [INF] LNWL: The wallet has been unlocked without a time limit 2018-03-19 11:03:13.551 [INF] LTND: LightningWallet opened 2018-03-19 11:03:13.553 [INF] LNWL: Catching up block hashes to height 514227, this will take a while... 2018-03-19 11:03:43.848 [WRN] LNWL: Unable to synchronize wallet to chain: Post http://localhost:8332: EOFand this in lncli:
lncli stop [lncli] rpc error: code = Unavailable desc = grpc: the connection is unavailable
The unable-to-synchronize thing looks a bit like the common issue with bitcoind connection loss, but why does it lose connection to lncli?