Lightning Terminal (litd) — Lightning Network Node
Install and operate a Lightning Terminal (litd) node for agent-driven payments.
litd bundles lnd with loop, pool, tapd, and faraday — giving agents access to
liquidity management, channel marketplace, and taproot assets in a single
container.
Default: Docker container, neutrino backend, SQLite storage, testnet. No full
Bitcoin node required. Use --network mainnet for real coins.
Default mode: watch-only with remote signer. Private keys stay on a separate
signer container — the agent never touches key material. For quick testing, use
--mode standalone (keys on disk, less secure).
Quick Start (Container — Recommended)
Watch-Only with Remote Signer (Production)
CODEBLOCK0
Standalone (Testing Only)
CODEBLOCK1
Warning: Standalone mode stores the seed mnemonic and wallet passphrase on
disk. Do not use for mainnet funds you cannot afford to lose.
Regtest Development
CODEBLOCK2
Container Modes
| Mode | Command | Containers | Use Case |
|---|
| Standalone | INLINECODE2 | litd | Testing, development |
| Watch-only |
start-lnd.sh --watchonly | litd + litd-signer | Production |
| Regtest |
start-lnd.sh --regtest | litd + litd-bitcoind | Local dev |
Profiles
Profiles customize litd behavior without editing compose files:
CODEBLOCK3
| Profile | Purpose |
|---|
| INLINECODE5 | Standard operation (info logging) |
| INLINECODE6 |
Trace logging, verbose subsystems |
|
taproot | Simple taproot channels enabled |
|
wumbo | Large channels up to 10 BTC |
|
regtest | Regtest network preset |
Network Selection
Default is testnet. Override with --network:
CODEBLOCK4
litd Sub-Daemons
litd integrates multiple daemons. Access them via the --cli flag:
CODEBLOCK5
Installation
Default: pulls the litd Docker image.
CODEBLOCK6
This pulls lightninglabs/lightning-terminal:v0.16.0-alpha from Docker Hub and
verifies the image. The litd image includes lncli, litcli, loop, pool, tapcli,
and frcli.
Build from Source (Fallback)
CODEBLOCK7
Requires Go toolchain. Builds lnd and lncli with all build tags.
Native Mode
For running without Docker, use --native:
CODEBLOCK8
Native mode uses the config template at skills/lnd/templates/lnd.conf.template
and runs lnd as a background process.
Remote Nodes
Connect to a remote lnd node with connection credentials:
CODEBLOCK9
MCP / Lightning Node Connect
For read-only access without direct gRPC connectivity, use the
lightning-mcp-server skill with Lightning Node Connect (LNC). LNC uses
encrypted WebSocket tunnels — no TLS certs, macaroons, or open ports needed.
Just a pairing phrase from Lightning Terminal.
CODEBLOCK10
Wallet Setup
Watch-Only Wallet (Default)
Imports account xpubs from the remote signer — no seed or private keys on this
machine.
CODEBLOCK11
Standalone Wallet
Generates a seed locally. Use only for testing.
CODEBLOCK12
Handles the full wallet creation flow via REST API:
- 1. Generates a secure random wallet passphrase
- Calls
/v1/genseed to generate a 24-word seed mnemonic - Calls
/v1/initwallet with the passphrase and seed - Stores credentials securely:
-
~/.lnget/lnd/wallet-password.txt (mode 0600)
-
~/.lnget/lnd/seed.txt (mode 0600)
Unlock Wallet
CODEBLOCK13
Auto-unlock is enabled by default in the container via
--wallet-unlock-password-file. Manual unlock is only needed if auto-unlock
is disabled.
Recover Wallet from Seed (Standalone Only)
CODEBLOCK14
Starting and Stopping
Start
CODEBLOCK15
Stop
CODEBLOCK16
Node Operations
All commands auto-detect the litd container:
Node Info
CODEBLOCK17
Funding
CODEBLOCK18
Channel Management
CODEBLOCK19
Payments
CODEBLOCK20
Macaroon Bakery
Use the macaroon-bakery skill for least-privilege agent credentials:
CODEBLOCK21
Configuration
Container Config
The Docker compose templates pass configuration via command-line arguments. For
advanced customization, mount a custom litd.conf:
- - litd template: INLINECODE23
- lnd template (native): INLINECODE24
Note: litd requires lnd. prefix for lnd flags (e.g., lnd.bitcoin.active).
Standalone lnd does not use the prefix.
Key Defaults
- - Backend: neutrino (BIP 157/158 light client)
- Database: SQLite
- Network: testnet (override with
--network mainnet) - Auto-unlock: enabled via password file
Container Naming & Ports
| Container | Purpose | Ports |
|---|
| INLINECODE28 | Main Lightning Terminal | 8443, 10009, 9735, 8080 |
| INLINECODE29 |
Remote signer (lnd) | 10012, 10013 |
|
litd-bitcoind | Bitcoin Core (regtest only) | 18443, 28332, 28333 |
Port Reference
| Port | Service | Description |
|---|
| 8443 | litd UI | Lightning Terminal web UI |
| 9735 |
Lightning | Peer-to-peer Lightning Network |
| 10009 | gRPC | lncli and programmatic access |
| 8080 | REST | REST API (wallet, etc.) |
| 10012 | Signer gRPC | Remote signer RPC |
| 10013 | Signer REST | Signer REST API |
File Locations
| Path | Purpose |
|---|
| INLINECODE31 | Wallet unlock passphrase (0600) |
| INLINECODE32 |
24-word mnemonic backup (0600, standalone only) |
|
~/.lnget/lnd/signer-credentials/ | Imported signer credentials (watch-only) |
|
versions.env | Pinned container image versions |
|
skills/lnd/templates/ | Docker compose and config templates |
|
skills/lnd/profiles/ | Profile .env files |
Version Pinning
Container image versions are pinned in versions.env at the repo root:
CODEBLOCK22
Override at runtime:
CODEBLOCK23
Integration with lnget
Once litd is running with a funded wallet and open channels:
CODEBLOCK24
Security Considerations
See references/security.md for detailed guidance.
Default model (watch-only with remote signer):
- - No seed or private keys on the agent machine
- Signing delegated to signer container via gRPC
- Set up with the
lightning-security-module skill
Standalone model (testing only):
- - Wallet passphrase and seed stored on disk (0600)
- Suitable for testnet and quick testing
Macaroon security:
- - Never give agents the admin macaroon in production
- Bake scoped macaroons with the
macaroon-bakery skill
Troubleshooting
"wallet not found"
Run
skills/lnd/scripts/create-wallet.sh to create the wallet.
"wallet locked"
Run
skills/lnd/scripts/unlock-wallet.sh. Auto-unlock is enabled by default.
"chain backend is still syncing"
Neutrino needs time to sync headers:
CODEBLOCK25
Container not starting
CODEBLOCK26
"remote signer not reachable"
CODEBLOCK27
Lightning Terminal (litd) — 闪电网络节点
安装并运行一个用于代理驱动的支付的 Lightning Terminal (litd) 节点。
litd 将 lnd 与 loop、pool、tapd 和 faraday 捆绑在一起——使代理能够在一个容器中访问流动性管理、通道市场和 taproot 资产。
默认配置: Docker 容器、neutrino 后端、SQLite 存储、测试网。无需完整的比特币节点。使用 --network mainnet 处理真实币。
默认模式:仅监视模式,带远程签名器。 私钥保存在单独的签名器容器中——代理从不接触密钥材料。如需快速测试,使用 --mode standalone(密钥在磁盘上,安全性较低)。
快速开始(容器——推荐)
带远程签名器的仅监视模式(生产环境)
bash
1. 安装 litd 镜像
skills/lnd/scripts/install.sh
2. 启动 litd + 签名器容器
skills/lnd/scripts/start-lnd.sh --watchonly
3. 设置签名器钱包(仅首次运行)
skills/lightning-security-module/scripts/setup-signer.sh --container litd-signer
4. 导入凭证并创建仅监视钱包
skills/lnd/scripts/import-credentials.sh --bundle ~/.lnget/signer/credentials-bundle
skills/lnd/scripts/create-wallet.sh
5. 检查状态
skills/lnd/scripts/lncli.sh getinfo
独立模式(仅测试)
bash
1. 安装 litd 镜像
skills/lnd/scripts/install.sh
2. 启动 litd 容器
skills/lnd/scripts/start-lnd.sh
3. 创建独立钱包(生成种子——密钥在磁盘上)
skills/lnd/scripts/create-wallet.sh --mode standalone
4. 检查状态
skills/lnd/scripts/lncli.sh getinfo
警告: 独立模式将种子助记词和钱包密码短语存储在磁盘上。请勿用于您无法承受损失的主网资金。
Regtest 开发
bash
启动 litd + bitcoind 用于本地开发
skills/lnd/scripts/start-lnd.sh --regtest
创建钱包并挖一些区块
skills/lnd/scripts/create-wallet.sh --container litd --mode standalone
docker exec litd-bitcoind bitcoin-cli -regtest -generate 101
容器模式
| 模式 | 命令 | 容器 | 用途 |
|---|
| 独立模式 | start-lnd.sh | litd | 测试、开发 |
| 仅监视模式 |
start-lnd.sh --watchonly | litd + litd-signer | 生产环境 |
| Regtest | start-lnd.sh --regtest | litd + litd-bitcoind | 本地开发 |
配置文件
配置文件可自定义 litd 行为,无需编辑 compose 文件:
bash
列出可用配置文件
skills/lnd/scripts/docker-start.sh --list-profiles
使用配置文件启动
skills/lnd/scripts/start-lnd.sh --profile taproot
skills/lnd/scripts/start-lnd.sh --profile debug
| 配置文件 | 用途 |
|---|
| default | 标准操作(信息日志) |
| debug |
跟踪日志,详细子系统 |
| taproot | 启用简单 taproot 通道 |
| wumbo | 高达 10 BTC 的大通道 |
| regtest | Regtest 网络预设 |
网络选择
默认为测试网。使用 --network 覆盖:
bash
测试网(默认——无真实币)
skills/lnd/scripts/start-lnd.sh
主网(真实币——与远程签名器一起使用)
skills/lnd/scripts/start-lnd.sh --network mainnet --watchonly
Signet(测试网络)
skills/lnd/scripts/start-lnd.sh --network signet
litd 子守护进程
litd 集成了多个守护进程。通过 --cli 标志访问它们:
bash
lnd CLI(默认)
skills/lnd/scripts/lncli.sh getinfo
Loop——流动性管理(潜艇交换)
skills/lnd/scripts/lncli.sh --cli loop quote out 100000
Pool——通道市场
skills/lnd/scripts/lncli.sh --cli pool accounts list
Taproot 资产(tapd)
skills/lnd/scripts/lncli.sh --cli tapcli assets list
Lightning Terminal(litd)
skills/lnd/scripts/lncli.sh --cli litcli getinfo
Faraday——通道分析
skills/lnd/scripts/lncli.sh --cli frcli revenue
安装
默认:拉取 litd Docker 镜像。
bash
skills/lnd/scripts/install.sh
这会从 Docker Hub 拉取 lightninglabs/lightning-terminal:v0.16.0-alpha 并验证镜像。litd 镜像包含 lncli、litcli、loop、pool、tapcli 和 frcli。
从源码构建(备用方案)
bash
skills/lnd/scripts/install.sh --source
需要 Go 工具链。使用所有构建标签构建 lnd 和 lncli。
原生模式
如需在没有 Docker 的情况下运行,使用 --native:
bash
原生启动
skills/lnd/scripts/start-lnd.sh --native --mode standalone
原生停止
skills/lnd/scripts/stop-lnd.sh --native
原生模式使用 skills/lnd/templates/lnd.conf.template 的配置模板,并将 lnd 作为后台进程运行。
远程节点
使用连接凭证连接到远程 lnd 节点:
bash
skills/lnd/scripts/lncli.sh \
--rpcserver remote-host:10009 \
--tlscertpath ~/remote-tls.cert \
--macaroonpath ~/remote-admin.macaroon \
getinfo
MCP / Lightning Node Connect
如需在没有直接 gRPC 连接的情况下进行只读访问,请使用 lightning-mcp-server 技能配合 Lightning Node Connect(LNC)。LNC 使用加密的 WebSocket 隧道——无需 TLS 证书、macaroon 或开放端口。只需 Lightning Terminal 的配对短语。
bash
skills/lightning-mcp-server/scripts/install.sh
skills/lightning-mcp-server/scripts/configure.sh
skills/lightning-mcp-server/scripts/setup-claude-config.sh
钱包设置
仅监视钱包(默认)
从远程签名器导入账户 xpub——此机器上没有种子或私钥。
bash
从签名器导入凭证包
skills/lnd/scripts/import-credentials.sh --bundle
创建仅监视钱包(自动检测 litd 容器)
skills/lnd/scripts/create-wallet.sh
独立钱包
本地生成种子。仅用于测试。
bash
skills/lnd/scripts/create-wallet.sh --mode standalone
通过 REST API 处理完整的钱包创建流程:
- 1. 生成安全的随机钱包密码短语
- 调用 /v1/genseed 生成 24 词种子助记词
- 使用密码短语和种子调用 /v1/initwallet
- 安全存储凭证:
- ~/.lnget/lnd/wallet-password.txt(模式 0600)
- ~/.lnget/lnd/seed.txt(模式 0600)
解锁钱包
bash
skills/lnd/scripts/unlock-wallet.sh
容器中默认通过 --wallet-unlock-password-file 启用自动解锁。仅当自动解锁被禁用时才需要手动解锁。
从种子恢复钱包(仅独立模式)
bash
skills/lnd/scripts/create-wallet.sh --mode standalone --recover --seed-file ~/.lnget/lnd/seed.txt
启动和停止
启动
bash
Docker 独立模式(默认)
skills/lnd/scripts/start-lnd.sh
Docker 仅监视模式(生产环境)
skills/lnd/scripts/start-lnd.sh --watchonly
Docker 使用配置文件
skills/lnd/scripts/start-lnd.sh --profile taproot
主网
skills/lnd/scripts/start-lnd.sh --network mainnet
停止
bash
停止(保留数据)
skills/lnd/scripts/stop-lnd.sh
停止并清理(移除卷)
skills/lnd/scripts/stop-lnd.sh --clean
停止所有 litd 容器
skills/lnd/scripts/stop-lnd.sh --all
节点操作
所有命令自动检测 litd 容器:
节点信息
bash
skills/lnd/scripts/lncli.sh getinfo
skills/lnd