c-lightning Lightning network configuration onion service (tor)

I just verified it in 5.2 mode
My system: Linux vbtc 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

1. For the installation and configuration of tor, please refer to "tor Hidden Service Configuration (Bitcoin).txt"
2. Create a hidden service (tor2) for the persistent .onion address.
    Add the following lines to the /etc/tor/torrc file:
                      HiddenServiceDir /var/lib /tor/lightningd-service_v2/
          HiddenServicePort 1234 127.0.0.1:9735
                Save the file and restart the Tor service: /etc/init.d/tor restart
                can be found in /var/lib/tor/var/lib/tor/lightningd-service_v2/ hostname found the newly created address
               NOTE:
                       Version 2 onion addresses remain unchanged across Tor service restarts. It is created when you create a Tor hidden service.
3. Check the external address:
              curl ipinfo.io/ip
4. Check the internal address
               ip route get 1 | awk '{print $NF;exit}'
5. c-lightning parameter configuration (5.1 or 5.2):
               5.1, (on the server Configuration) c-lightning has a public IP address and a fixed Tor hidden service address that is persistent so external users can connect to the node. parameter
                       --bind-addr=yourInternalIPAddress:port --announce-addr=yourexternalIPAddress:port --announce-addr=your.onionAddress:port` 

              Note:
         your.onionAddress was created using the Tor hidden service (see above). Port is the port indicated as the hidden service port. If the hidden service creation line is the HiddenServicePort 1234 127.0.0.1:9735.onion address, it can be accessed on port 1234 (global port).
                                 Connect to this node via: lightning-cli connect nodeID .onionAddress globalPort or lightning-cli connect nodeID yourexternalIPAddress Port


               5.2. (Local personal development environment) c-lightning does not have a public IP address, but has a fixed Tor hidden service address that is persistent. Parameters:
        --bind-addr=yourInternalIPAddress:port --announce-addr=your.onionAddress:port
                Verification:
                                 lightning-cli getinfo can see the .onion address
 
                5.3. By specifying, the node can be connected to via IPV4/6 socks 5 proxy Any V4/6 IP address:
        --proxy=127.0.0.1:9050 --always-use-proxy

Reference:
               https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service
               https://github.com/ElementsProject/lightning/blob/master/doc/TOR.md
               lightning-cli -help

Guess you like

Origin blog.csdn.net/yinzhiqing/article/details/88875564