Builder's Guide
  • Welcome to the Builder's Guide to the LND Galaxy!
  • The Lightning Network
    • Overview
    • Payment Channels
      • Lifecycle of a Payment Channel
      • Watchtowers
      • Understanding Sweeping
      • Etymology
    • The Gossip Network
      • Identifying Good Peers on the Lightning Network
    • Pathfinding
      • Finding routes in the Lightning Network
      • Channel Fees
      • Multipath Payments (MPP)
    • Lightning Network Invoices
      • Understanding Lightning Invoices
    • Making Payments
      • The Payment Cycle
      • Timelocks
      • ⭐Hashed Timelock Contract (HTLC)
      • Payment Etymology
      • ⭐What Makes a Good Routing Node
      • Understanding Submarine Swaps
      • Instant Submarine Swaps
    • Liquidity
      • ⭐Understanding Liquidity
      • Managing Liquidity on the Lightning Network
      • Liquidity Management for Lightning Merchants
      • How to Get Inbound Capacity on the Lightning Network
      • Lightning Service Provider
    • L402: Lightning HTTP 402 Protocol
      • Macaroons
      • L402
      • 📋Protocol Specification
      • Implementations and Links
    • Taproot Assets
      • Taproot Assets Protocol
      • Taproot Assets on Lightning
      • Edge Nodes
      • Taproot Assets Trustless Swap
      • FAQ
      • Glossary
  • Lightning Network Tools
    • LND
      • 🛠️Get Started
      • lnd.conf
      • First Steps With LND
      • Wallet Management
      • Sending Payments
      • Atomic Multi-path Payments (AMP)
      • Receiving Payments
      • Unconfirmed Bitcoin Transactions
      • Channel Fees
      • Inbound Channel Fees
      • Macaroons
      • Configuring Watchtowers
      • Pathfinding
      • Blinded Paths
      • Key Import
      • Secure Your Lightning Network Node
      • Configuration of a Routing Node
      • Quick Tor Setup
      • Configuring Tor
      • Enable ‘Neutrino mode’ in Bitcoin Core
      • Send Messages With Keysend
      • Partially Signed Bitcoin Transactions
      • Bulk onchain actions with PSBTs
      • Sweeper
      • Debugging LND
      • Fuzzing LND
      • LND API documentation
      • Channel Acceptor
      • RPC Middleware Interceptor
      • HTLC Interceptor
      • NAT Traversal
      • Recovery: Planning for Failure
      • Migrating LND
      • Disaster recovery
      • Contribute to LND
    • Lightning Terminal
      • What is Lightning Terminal?
      • 🛠️Get litd
      • Run litd
      • Integrating litd
      • Demo: Litd Speed Run
      • Connect to Terminal
      • Recommended Channels
      • Rankings
      • Health Checks
      • Liquidity Report
      • Opening Lightning Network Channels
      • Managing Channel Liquidity
      • Autofees
      • AutoOpen
      • LND Accounts
      • Loop and Lightning Terminal
      • Loop Fees
      • Pool and Lightning Terminal
      • Command Line Interface
      • Troubleshooting
      • Lightning Node Connect: Under the hood
      • LNC Node Package
      • LITD API Documentation
      • Privacy and Security
      • Privacy Policy
      • Terms of Use
    • Loop
      • 🛠️Get Started
      • The Loop CLI
      • Autoloop
      • Static Loop In Addresses
      • Instant Loop Outs
      • Peer with Loop
      • Loop API Documentation
    • Pool
      • Overview
      • Quickstart
      • 🛠️Installation
      • First Steps
      • Accounts
      • Orders and Asks
      • Sidecar Channels
      • Zero-confirmation Channels
      • Channel Leases
      • Batch Execution
      • Account Recovery
      • Pool API Documentation
      • FAQs
    • Taproot Assets
      • Get Started
      • First Steps
      • Taproot Assets Channels
      • Asset Decimal Display
      • Become an Edge Node
      • RFQ
      • Collectibles
      • Universes
      • Asset Loop
      • Debugging Tapd
      • Multisignature
      • Minting Assets With an External Signer
      • Lightning Polar
      • Operational Safety Guidelines
      • Taproot Assets API Documentation
    • Aperture
      • ⚒️Get Aperture
      • LNC Backend
      • LNC Mailbox
      • Pricing
    • Faraday
      • 🛠️Get Started
      • The Faraday CLI
      • Faraday API Documentation
  • LAPPs
    • Guides
      • Use Polar to Build Your First LAPP
        • Setup: Local Cluster with Polar
        • Setup: Run the Completed App
        • Setup: Run the App Without LND
      • Add Features
        • Feature 1: Connect to LND
        • Feature 2: Display Node Alias and Balance
        • Feature 3: Sign and Verify Posts
        • Feature 4: Modify Upvote Action
      • Make Your own LNC-powered Application
    • Next Steps
  • Community Resources
    • Resource List
    • Lightning Bulb 💡
    • Glossary
    • FAQ
Powered by GitBook
On this page
  • Configure aperture
  • Run aperture
  • Connect to Terminal
  • Troubleshooting
  • Optional: Set up aperture with systemd

Was this helpful?

  1. Lightning Network Tools
  2. Aperture

LNC Mailbox

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.

Configure aperture

To configure aperture, we edit the configuration file.

nano ~/.aperture/aperture.yaml

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!

listenaddr: "lnc.yourlightning.app:443"
debuglevel: "trace"
autocert: true
servername: lnc.yourlightning.app
authenticator:
  disable: true
hashmail:
  enabled: true
  messagerate: 1ms
  messageburstallowance: 99999999
prometheus:
  enabled: false

Run aperture

To run aperture, we only need to execute one command.

aperture

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.

Connect to Terminal

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.

We can now connect, select and confirm a password and control our Lightning node remotely!

Troubleshooting

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 172.81.180.188:443: bind: cannot assign requested address [INF] APER: Shutdown complete

Optional: Set up aperture with systemd

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

[Unit]
Description=LNC mailbox service

[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/usr/local/bin/aperture
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

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

PreviousLNC BackendNextPricing

Last updated 17 days ago

Was this helpful?

We can now connect our LND node to Lightning Terminal using our own mailbox. You will need litd running alongside LND. Learn how to .

install litd here
Connect your node to Lightning Terminal via LNC and your own proxy server