-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: LND uses deprecated 'getinfo' Bitcoin Core API; cannot connect to node #7256
Comments
If you are searching for rpc calls etc. bear in mind that LND depends on code in the btcsuite libraries so you may find them in there. I would recommend connecting to a remote bitcoind node over wireguard. This works just fine. It's the JSON-RPC interface that you need, not the REST interface which is very limited |
I think it is trying to request getinfo from a btcd client. |
I did use the JSON-RPC interface, it's visible in the logs (though content is a bit mangled):
Thanks for the hint regarding wireguard, I may give a try, though the effect is probably very similar to my nginx proxy setup. |
I have no idea, but in that case why is it trying a btcd client, when btcd is not configured at all? |
An extra tidbit info: I managed to connect C-Lightning to the same remote-bitcoind-over-nginx-proxy setup since then, and it worked fine. This just shows to me that the problem is not with the remote node setup, but with LND setup. |
Could you check the exact
It uses this method to decide whether it's from
I think so. My guess is the returned error from |
Could this be an authentication issue? Because the very last part of the error shows: |
Same issue, if I connect to a remote bitcoind RPC, I met the same issue. But I can get the right response via CURL, ip, port, user/passwd all is right. If I connect to my local bitcoind RPC, 127.0.0.1, it works. if I used the eth0 interface(etc, 192.168.0.2), it doesn't work. |
The problem isn't that So I think you need to configure |
That's a plausible explanation, thanks. |
Background
I have experienced issues connecting LND to Bitcoin Core, and while debugging I found that LND invokes the long-deprecated 'getinfo' API on Bitcoin Core RPC. I am not sure that this is the reason for the disconnection, but seems so, and it seems incorrect.
The bigger-context question is how is it possible to connect LND to a remote BTC node over HTTPS.
Your environment
lnd
:v0.15.4-beta
uname -a
on *Nix)Linux ip-10-242-51-151 5.15.0-1026-aws #30~20.04.2-Ubuntu SMP Fri Nov 25 14:53:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
bitcoind
: recent Bitcoin Core, exact version not knownSteps to reproduce
~/lnd/lnd-debug --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpchost=localhost --bitcoind.rpcuser=X --bitcoind.rpcpass=Y --bitcoind.zmqpubrawblock=tcp://localhost:8332 --bitcoind.zmqpubrawtx=tcp://localhost:8333
~/lnd/lncli-debug create
(new wallet, default options). (In subsequent runs, used onlyunlock
.)lnd successfully unlocked!
As seen, first
getblockhash
API is invoked, thengetblockchaininfo
, and thengetinfo
. The last call returns 403 error code, because this API does not exist.BTC RPC reference: https://developer.bitcoin.org/reference/rpc/
Expected behaviour
Connect to the node, start up.
Actual behaviour
LND shuts down.
My questions
getinfo
BTC API?getinfo
the reason of shutdown?Note that after a short search I have not able to find an instance of invoking 'getinfo' in the LND codebase.
Update: Extra info: C-Lightning configured with the same remote-bitcoind-over-nginx-proxy instance worked fine.
The text was updated successfully, but these errors were encountered: