Skip to content

Commit 03f0825

Browse files
committed
add readme
1 parent c4fad2b commit 03f0825

File tree

4 files changed

+140
-9
lines changed

4 files changed

+140
-9
lines changed

Diff for: LnAddress.Net.sln

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "custom_lnd", "custom_lnd",
1717
tests\Docker\custom_lnd\bashrc = tests\Docker\custom_lnd\bashrc
1818
EndProjectSection
1919
EndProject
20-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{8252A03E-5DBF-4930-8A02-15E10D3CBBC3}"
21-
ProjectSection(SolutionItems) = preProject
22-
docker\docker-compose.yml = docker\docker-compose.yml
23-
EndProjectSection
24-
EndProject
2520
Global
2621
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2722
Debug|Any CPU = Debug|Any CPU

Diff for: README.md

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# LnAddress.Net
2+
3+
**LnAddress.Net** is a service that allows you to receive Lightning payments using any username at your domain. For
4+
example: `[email protected]`.
5+
6+
## Overview
7+
8+
- **Docker Image**: A pre-built Docker image is available
9+
at [ipmsio/lnaddress.net](https://hub.docker.com/r/ipmsio/lnaddress.net).
10+
- **Configuration Reference**: Review the [docker-compose.yml](docker-compose.yml) file for a complete list of
11+
environment variables and configuration options.
12+
- **Reverse Proxy Setup**: An example Nginx configuration is provided in [example.nginx](example.nginx).
13+
14+
## Getting Started
15+
16+
1. **Pull the Docker Image**:
17+
18+
```bash
19+
docker pull ipmsio/lnaddress.net:latest
20+
```
21+
22+
2. **Review Configuration Variables**:
23+
24+
Check the [docker-compose.yml](docker-compose.yml) file for environment variables. These variables allow you to:
25+
26+
- Configure connection details to your LND instance.
27+
- Adjust limits for payment amounts or comment fields.
28+
29+
3. **Set Up Nginx (Optional)**:
30+
31+
For a production setup, use [example.nginx](example.nginx) as a guide to set up a reverse proxy with TLS termination.
32+
33+
## Connecting to LND
34+
35+
To enable Lightning payments, you need to connect LnAddress.Net to your LND instance. You will need:
36+
37+
- The **TLS certificate** (`tls.cert`)
38+
- The **admin.macaroon** in base64 format
39+
- The **LND RPC server endpoint**
40+
41+
**Steps to Obtain LND Credentials**:
42+
43+
1. **TLS Certificate**:
44+
45+
Extract the certificate content between the `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----` lines.
46+
47+
```bash
48+
cat /.lnd/tls.cert
49+
```
50+
51+
Copy only the certificate portion without the header and footer lines.
52+
53+
2. **Admin Macaroon**:
54+
55+
Convert the `admin.macaroon` to a single-line base64 string:
56+
57+
```bash
58+
base64 /.lnd/data/chain/bitcoin/mainnet/admin.macaroon | tr -d '\n'
59+
```
60+
61+
3. **RPC Server URL**:
62+
63+
Set your LND RPC endpoint, for example:
64+
65+
```bash
66+
https://<lnd-ip>:10009
67+
```
68+
69+
Ensure your `lnd.conf` includes:
70+
71+
```ini
72+
rpclisten=0.0.0.0:10009
73+
```
74+
75+
This makes LND’s RPC interface accessible to LnAddress.Net.
76+
77+
## Default Settings
78+
79+
- **MinSendable**: 1,000 millisatoshis (1 satoshi)
80+
- **MaxSendable**: 100,000,000 millisatoshis (100,000 satoshis)
81+
- **MaxCommentAllowed**: 0 (no comments accepted)
82+
83+
If these defaults don’t meet your needs, adjust them via environment variables as shown
84+
in [docker-compose.yml](docker-compose.yml).
85+
86+
## Running the Service
87+
88+
Once you have your environment variables set and Docker is ready, you can run:
89+
90+
```bash
91+
docker-compose up -d
92+
```
93+
94+
or, if running standalone:
95+
96+
```bash
97+
docker run -d \
98+
-p 80:80 \
99+
-e LND_TLS_CERT="<base64_tls_cert>" \
100+
-e LND_MACAROON="<base64_admin_macaroon>" \
101+
-e LND_SERVER_URL="https://<lnd-ip>:10009" \
102+
ipmsio/lnaddress.net:latest
103+
```
104+
105+
Replace the environment variables with your actual values.
106+
107+
---
108+
109+
**You’re now set up to receive Lightning payments via username addresses on your domain!**

Diff for: docker/docker-compose.yml renamed to docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
lnaddress.net:
33
image: ipmsio/lnaddress.net:latest
44
ports:
5-
- "64260:80"
5+
- "65535:80"
66
networks:
77
- app-network
88
environment:
@@ -13,14 +13,14 @@ services:
1313
- LND__RPCADDRESS=https://your.lnd.address:10009
1414
- INVOICE__MINSENDABLE=10000
1515
- INVOICE__MAXSENDABLE=100000000
16-
- INVOICE_MAXCOMMENTALLOWED=255
16+
- INVOICE__MAXCOMMENTALLOWED=255
1717
restart: unless-stopped
1818
healthcheck:
19-
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
19+
test: [ "CMD", "curl", "-f", "http://localhost:80/health" ]
2020
interval: 30s
2121
timeout: 10s
2222
retries: 3
2323

2424
networks:
2525
app-network:
26-
driver: bridge
26+
driver: bridge

Diff for: example.nginx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
server {
2+
server_name your.domain;
3+
root /var/www/your.domain;
4+
index index.html;
5+
6+
# make sure this two blocks comes first
7+
location /.well-known/lnurlp/ {
8+
proxy_pass http://localhost:65535;
9+
proxy_set_header Host $host;
10+
proxy_set_header X-Real-IP $remote_addr;
11+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
12+
proxy_set_header X-Forwarded-Proto $scheme;
13+
}
14+
15+
location /lnurl/ {
16+
proxy_pass http://localhost:65535;
17+
proxy_set_header Host $host;
18+
proxy_set_header X-Real-IP $remote_addr;
19+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20+
proxy_set_header X-Forwarded-Proto $scheme;
21+
}
22+
23+
# the rest of you server code
24+
location / {
25+
try_files $uri $uri/ =404;
26+
}
27+
}

0 commit comments

Comments
 (0)