ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.82k stars 896 forks source link

Sending lightning payment between TOR lighning nodes, any specific setup required? #3806

Closed johnblanc closed 4 years ago

johnblanc commented 4 years ago

I have two c-lightning nodes in different VMs in Qubes OS, both routed through TOR VM. They both can connect to other public nodes and establish channels with them but when I try sending satoshis between them the sending node gives "Could not find a route" code 205 right away, like it's not even trying. At the same time in the terminal where lightningd is running I get:

20-07-01T12:46:17.482Z DEBUG gossipd: REPLY WIRE_GOSSIP_GETCHANNELS_REPLY with 0 fds 2020-07-01T12:46:17.484Z DEBUG gossipd: Trying to find a route from (me) to 0xxx_ID_EDITEDOUT_XXX for 40000000msat 2020-07-01T12:46:17.484Z DEBUG gossipd: REPLY WIRE_GOSSIP_GETROUTE_REPLY with 0 fds

Is it possible the problem for that to be related to TOR, considering that I can connect to and open channels with public nodes just fine? I haven't opened direct channel between the nodes, since I want to play with routing. But each of those nodes has established channel with some of the most well connected nodes, so route exist for sure.

ZmnSCPxj commented 4 years ago

You could try dumping listchannels output and see if the paying node does have a route. Note that this will dump the entire routemap, which will be pretty long and in practice will require some program to process.

Can you show output of lightning-cli getroute $xxx_ID_EDITED_OUT_XXX 1000 20?

ZmnSCPxj commented 4 years ago

You could try as well lightning-cli listchannels $NODE where $NODE is the node ID of the node you re calling, then lightning-cli listchannels $xxx_ID_EDITED_OUT_XXX where $xxx_ID_EDITED_OUT_XXX is the other node, as a simple debug to see if the gossipd knows of the nodes in the first place. If one or the other comes up empty then the channel gossip is not being propagated correctly for some reason.

Note that there should not be any special setup for paying between Tor nodes, Tor is just another way to be contacted over, and has no bearing on the payment system overall. (operative word here being "should")

Saibato commented 4 years ago

Are the nodes bound to 0.0.0.0 or 127.0.0.1 and do u use static torrc or our c-ln autogen tor onion service?

can u connect to your nodes onion address? just try nc connect to your hidden onion service to see if you can access over tor.

nc -vv -x 127.0.0.1:9050 <youroninaddress>.onion 9735

replace youroninaddress with the one your node announces
you should get an answer like ` Connection to sn4sdl6tx5sisiem.onion 9735 port [tcp/*] succeeded!`

At least than you know you have a technical reachable nodes over tor and your onion service. Since you have opened channels to other nodes, have any of your nodes so far had any inbound traffic or opened channels to you?

johnblanc commented 4 years ago

Thank you guys, after further playing turns out it was the plain old inbound capacity problem. c-lightning over tor works perfect out of the box!

ZmnSCPxj commented 4 years ago

...okay. closing.