Install your own Lightning Node Connect relay proxy server, the mailbox, which comes bundled in Aperture.
Lightning Node Connect (LNC) is a protocol that establishes a connection between your Lightning Network node (LND) and a remote application, such as Lightning Terminal or Zeus.
To traverse firewalls and Network Address Translation (NAT), LNC makes use of a mailbox proxy. This proxy is part of the open-source aperture and can be installed freely by anybody.
LNC is most useful when both the client and the Lightning node are behind a firewall or NAT, but it can also be useful when only the Lightning node is unreachable. In this case, aperture may be installed on the same machine as the client application.
To configure aperture, we edit the configuration file.
You may use this template and don’t forget to swap the domain name with your own. This domain name should also point to the server on which you are setting up aperture!
To run aperture, we only need to execute one command.
The logs may show that aperture is now listening for connections.
[INF] APER: Configuring autocert for server lnc.yourlightning.app with cache dir /root/.aperture/autocert [INF] APER: Starting the server, listening on lnc.yourlightning.app:443.
litcli sessions add --label="My own mailbox" --type admin --mailboxserveraddr lnc.yourlightningapp:443
Next we type the generated 10-word connection string into Lightning Terminal, together with the url and port number of our mailbox.
Connect your node to Lightning Terminal via LNC and your own proxy server
We can now connect, select and confirm a password and control our Lightning node remotely!
On some VPS providers, aperture fails to correctly bind to the address and port it listens on.
root@mailbox:~# aperture [INF] APER: Configuring autocert for server lnc.yourlightningapp.com with cache dir /home/ubuntu/.aperture/autocert [INF] APER: Starting the server, listening on lnc.yourlightningapp.com:443. [ERR] APER: Error while running aperture: listen tcp 126.96.36.199:443: bind: cannot assign requested address
[INF] APER: Shutdown complete
We navigate to the systemd directory and create a new service.
cd /etc/systemd/system sudo nano aperture.service
Here we may paste the following template
Description=LNC mailbox service
To reload the list of services
sudo systemctl daemon-reload
To start the aperture service
sudo systemctl start aperture.service
To check the status of the service
sudo systemctl status aperture.service