Skip to content

Commit

Permalink
Generalized
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Dec 24, 2024
1 parent 584f259 commit a9db8a5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ jobs:
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
with:
name: snlncreceiver
path: dist/snlncreceiver
name: lncd
path: dist/lncd

- name: Upload artifact on release
if: github.event_name == 'release'
uses: actions/upload-artifact@v3
with:
name: snlncreceiver
path: dist/snlncreceiver
name: lncd
path: dist/lncd

- name: Upload to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: dist/snlncreceiver
files: dist/lncd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# LNC *daemonized* Receiver
# LNC*Daemonized*

This is a Golang daemon that exposes lnc methods through a REST-like API, serving as a server-side alternative to lnc-web.

Currently, it supports only the `lnrpc.Lightning methods`.
Additional methods can be easily registered in `snlncreceiver.go`.
Additional methods can be easily registered in `lncd.go`.

Lifecycle of LNC connections is managed. Connections are reused whenever possible and are automatically terminated after a period of inactivity.

Expand All @@ -17,4 +17,12 @@ Configuration options can be specified via environment variables (all are option
| `LNC_STATS_INTERVAL` | `1*time.Minute` | Interval for logging connection pool statistics. |
| `LNC_DEBUG` | `false` | Flag to enable or disable debug logging. |
| `LNC_RECEIVER_PORT` | `7167` | Port on which the receiver server listens. |
| `LNC_RECEIVER_HOST` | `0.0.0.0` | Host address on which the receiver server listens. |
| `LNC_RECEIVER_HOST` | `0.0.0.0` | Host address on which the receiver server listens. |



## Intended scope

This was developed to serve as the backend for stacker.news' LNC receive attachments.
It has only been tested with the `lnrpc.Lightning.AddInvoice` method, so if you plan to use this as a general-purpose LNC connector, ensure you test and review it accurately.

4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
script_dir=$(dirname $0)
cd "$script_dir/snlncreceiver"
cd "$script_dir/lncd"
mkdir -p ../dist
go build -o ../dist/snlncreceiver .
go build -o ../dist/lncd .
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion snlncreceiver/log.go → lncd/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"google.golang.org/grpc/grpclog"
)

const Subsystem = "SN"
const Subsystem = "LNCD"

var (
log btclog.Logger
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
script_dir=$(dirname $0)
cd "$script_dir/snlncreceiver"
cd "$script_dir/lncd"
go run .

0 comments on commit a9db8a5

Please sign in to comment.