lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.67k stars 2.07k forks source link

RPC Server Over Tor #4939

Closed JPyke3 closed 2 years ago

JPyke3 commented 3 years ago

Background

I would like to connect to my lnd node rpcserver with lncli over tor

Your environment

HiddenService in Torrc:

HiddenServiceDir /var/lib/tor/rpcserver/
HiddenServicePort 10009 127.0.0.1:10009

Steps to reproduce

Run the command:

torsocks lncli --rpcserver mysupercool.onion:10009 unlock 

The following Error is returned:

[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp: address mysupercool.onion: no suitable address found"

Expected behaviour

It should connect to the RPC server on the other end, and interact with my lnd instance

aplnx commented 3 years ago

Hello! I am just looking for this. Is it possible to access rpcserver behind tor hidden services?

guggero commented 3 years ago

It is possible to use a hidden service with a remote wallet like Zeus LN. But lncli is currently not able to access an RPC server over tor, that would need a new proxy option.

hieblmi commented 2 years ago

@guggero @JPyke3 I have added a proxy option to lncli to allow for grpc calls over tor in this PR: https://github.com/lightningnetwork/lnd/pull/6032. I was able to successfully test these changes by commands like this: lncli --rpcserver=remoterpchost.onion:10009 --socksproxy=localhost:9050 --tlscertpath=/cert/path/tls.cert --macaroonpath=/macaroon/path/admin.macaroon fwdinghistory --start_time "-1h"

I appreciate your review and comments.

hieblmi commented 2 years ago

@guggero I messed up PR: https://github.com/lightningnetwork/lnd/pull/6032 when trying to rebase with master and I am not quite sure how to fix it. Should I close this PR and open a new one?

guggero commented 2 years ago

Yeah, looks pretty borked. If you're unable to fix it then yes, please close the broken one and open a new one. There hasn't been any review yet, so not much context will be lost.

hieblmi commented 2 years ago

@guggero I've created a new PR for the exact same change: https://github.com/lightningnetwork/lnd/pull/6279/files. Would you be able to re-add it to the next milestone?

DanGould commented 2 years ago

looks like this was closed by https://github.com/lightningnetwork/lnd/pull/6422

guggero commented 2 years ago

@DanGould thanks for spotting this! I agree that this was fixed by #6422.